cross platform mobile app development

think2

Senior member
Dec 29, 2009
250
3
81
Can Java (J2ME?) be used to build mobile apps that run on nearly all mobile phones and tablets including Windows phone?

If I google for "how to build cross platform mobile apps" I don't see much mention of Java. Instead, discussion seems to be most often comparing phone-gap, itanium and xamarin. Phone gap puts me off because it's browser based and has performance issues, itanium is ios and Android only and xamarin costs money and doesn't support outsiders of the main three like symbian or blackberry.

Is Java viable for mobile app development. I had a look at this
http://wiki.netbeans.org/CrossPlatformMobileSoftware and the tutorial linked to is a mere 8 years old. And this book
Building Mobile Applications with Java mentions only Android and iOS.
And this oracle web page looks to be at least 4 years old
JAVA FOR MOBILE DEVICES

Regarding xamarin, does anyone know the size of the ".net runtime" needed to support C# apps - do most phones already have this installed?
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
Android supports java natively and there are Java tools for iOS like RoboVM. Neither of these are truly cross-platform as you need to write specific code for the targeted platform. Cross platform usuallly means you can run the same code on different platforms with minimal changes.

The .net runtime is not installed on any mobile platform except Windows Phone; however that is Microsofts .net and not Xamarins. The Xamarin deployment packages will install whats needed for each target platfom.
 
Last edited:

purbeast0

No Lifer
Sep 13, 2001
53,636
6,512
126
while this won't help out your windows phone development, i've recently been using this tool called apportable that will port a native iOS app to android. i literally added 1 line of code to my code (just to set the screen size properly) and it built on android and worked perfectly. but you can use the same exact code and just use #ifdef's to run code based on the platform you are building on.

the only things that did NOT work perfectly were things like iAds, facebook sharing, and leaderboards. but that makes sense since those are platform independent big time. but the actual basic functionality works just fine and the game works flawlessly on both.

i'm in the midst of getting the ads to work though on the android side. they have a way to call native java code from the objective c side using their bridgekit. i'm nearly finished doing the ad stuff and once i have that done i'm going to publish it to the play store, then work on the facebook and leaderboard stuff shortly after. i hope it's not as much of a headache as this was because there was an admob issue that i finally solved yesterday via another method.

they offer a free version of apportable and they also have some pay versions that include some native libraries to use so you don't have to write your own code with their bridgekit. but since i'm just doing this as my own personal projects, i am using the free version.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
What's your app? The appropriateness of this solution depends on what you're doing. You can write your applicaiton as a mobile webapp and write a light-weight wrapper application for each platform.

Advantages:
- can still take advantage of platform specific features
- develop on a single webapp used by all platforms simultaneously
- users get updated features without downloading updates

This obviously won't work for something like a game, but it would work for something like a mail cient.
 

think2

Senior member
Dec 29, 2009
250
3
81
I don't want to say what the app is but can a web app access a local database? What is the best GUI toolkit to use?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I don't want to say what the app is but can a web app access a local database? What is the best GUI toolkit to use?

Web apps can access a local SQL database implemented in the browser (http://blog.darkcrimson.com/2010/05/local-databases/). With websockets I suppose it might be possible to bridge to an actual local database, but I don't know what the constraints on websockets are because I haven't used them yet.