Cross-platform Mobile Dev

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Is there a practical, viable framework for cross platform app development targeting, at least, iOS and Android? I've done native development for both platforms, but in considering the pursuit of a couple of new ideas I'm forced to conclude there is no way I have the time to write code for both.

I've heard of PhoneGap, and Qt. Is either of these a realistic choice? Anything else that is better?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Can you make it client-server so each "app" is basically a thin wrapper around webkit? That way most of the work and updates would be to the shared server part.

You might also then be able to add other platforms like Windows Phone, Blackberry
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,729
4,699
75
Can you make it client-server so each "app" is basically a thin wrapper around webkit?
You mean like PhoneGap? I think that's what it does, anyway. (I've never tried - well - any way of making mobile apps.)
popsci.com said:
PhoneGap allows you to repurpose existing Web-based applications, HTML, CSS and JavaScript into amazing mobile apps, and for multiple platforms at the same time. Unlike the others, it’s not a drag-and-drop tool; you will have to debug your app, fix any errors, and shepherd it through the submission process yourself. But if you don’t mind the extra work, it’s worth it to cover all the mobile-app markets in one fell swoop—for free.
http://www.popsci.com/diy/article/2010-01/point-and-click-apps
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I'm on the native/web app fence. The market still seems to feel that native apps are more polished and fluid. I've read that Qt "runs on" Android and iOS, but I don't know what that really means yet. I need to do some research, but was hoping for some quick pointers here.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
I'm on the native/web app fence. The market still seems to feel that native apps are more polished and fluid. I've read that Qt "runs on" Android and iOS, but I don't know what that really means yet. I need to do some research, but was hoping for some quick pointers here.
Like WxWidgets, Qt builds to the GUI of the native platform, for everything possible, by abusing C++. Android-lighthouse is the official one, and then there's necessitas under KDE's banner.

Neither are exceptionally mature, ATM, but I don't know how much of the alphaness applies to the dev tools v. Qt itself.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
You mean like PhoneGap? I think that's what it does, anyway. (I've never tried - well - any way of making mobile apps.)
http://www.popsci.com/diy/article/2010-01/point-and-click-apps

I was thinking more like when you use the IE web browser control as the main view of a Windows desktop app. It's still a native app, and you still have dialogs, local storage, can make web service calls on the side, etc. The browser widget events are exposed to the app that uses it, and you can control where it navigates to.

With that kind of app, as much of the logic, storage and computation as makes sense can reside on a remote server, and much of the UI and be updated on the server side since you're connecting to it with a browser widget.

If you end up putting everything on the server then maybe you don't need this and can just use the standard browser on the device, but if you want a hybrid it might be suitable.
 

BigDH01

Golden Member
Jul 8, 2005
1,631
88
91
I'm on the native/web app fence. The market still seems to feel that native apps are more polished and fluid. I've read that Qt "runs on" Android and iOS, but I don't know what that really means yet. I need to do some research, but was hoping for some quick pointers here.

I've done with work with PhoneGap and jQuery mobile. It's pretty easy to make a cross-platform application that works, but I wouldn't exactly call the UI "fluid." It may have improved since then however.
 

Bulldog13

Golden Member
Jul 18, 2002
1,655
1
81
I have used PhoneGap, I liked it. I used AngularJS in conjunction with it.
Everything worked out well with it. Any specific questions let me know.

I would say 95% of the code ends up being cross-platform. There will be a slight bit of branching. I ended up having to use some plugins (native code with functionality exposed via JS), but those were easy enough.

It well and truly becomes an exercise in web-app development. My JS skills were neophyte at best so any issues I ran into were not so much the platform or the PhoneGap API, but just JS development.

On JQM vs Angular. JQM will give you a much better looking app and will have a more "native" feel, but Angular, I felt, allowed you to write a much better structured app. What I ended up doing was ripping the CSS out of JQM for the controls I wanted and just using that with Angular. I do not recommend using both JS frameworks as this will lead to MASSIVE headaches, especially if you are new to either one, as you won't know if the error is due to you writing something wrong or the 2 frameworks fighting.
 
Last edited:

mosco

Senior member
Sep 24, 2002
940
1
76
As someone who briefly worked on a competing product, unless your app is really simple and doesn't require any type of transitions or anything pretty, I wouldn't use something like Phonegap. I know it sucks to write two apps, but there is a reason that companies like facebook and linkedin moved away from hybrid apps.

That doesn't mean you can't use Webviews in your app, but I would only use them for parts of the app that just need to display information (no interaction) and certainly not base your entire app on a Hybrid app framework.

Webviews on iOS are pretty sucky, and they are the only part of Android I find easier to work with. Apple is always messing with Webview behavior between iOS versions.

I will also throw out there that I found the iOS code of Phonegap to be subpar. I haven't looked at the Android Phonegap code.

If you want to build business logic that will work on both platforms, I would look at using the NDK on Android and using the same code on iOS. Stick to native UI code and native design paradigms.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
As someone who briefly worked on a competing product, unless your app is really simple and doesn't require any type of transitions or anything pretty, I wouldn't use something like Phonegap. I know it sucks to write two apps, but there is a reason that companies like facebook and linkedin moved away from hybrid apps.

That doesn't mean you can't use Webviews in your app, but I would only use them for parts of the app that just need to display information (no interaction) and certainly not base your entire app on a Hybrid app framework.

Webviews on iOS are pretty sucky, and they are the only part of Android I find easier to work with. Apple is always messing with Webview behavior between iOS versions.

I will also throw out there that I found the iOS code of Phonegap to be subpar. I haven't looked at the Android Phonegap code.

If you want to build business logic that will work on both platforms, I would look at using the NDK on Android and using the same code on iOS. Stick to native UI code and native design paradigms.

Unfortunately, I suspect this is good advice. Thanks :).
 

Puddle Jumper

Platinum Member
Nov 4, 2009
2,835
1
0
I haven't looked at it personally but one of my colleages recently took a look at some of the cross platform options and said he preferred Titanium to Phonegapp.
 

mosco

Senior member
Sep 24, 2002
940
1
76
I haven't looked at it personally but one of my colleages recently took a look at some of the cross platform options and said he preferred Titanium to Phonegapp.

Titanium is better than phonegap, but you are still at the mercy of Webviews.