Cross-platform way of retrieving GPS position on mobile devices? - mobile

I'm planning to write a small app that should work on at least the popular smartphone devices, but would like (if possible) to write it only once for all platforms (using something like jQuery Mobile).
Is there any way to retrieve (to within at least street-level accuracy) the current GPS position of a mobile device, without writing custom code for each possible platform?

If you're programming natively, you're out of luck. Apple iOS and Android are very different beasts. Your best bet would be a browser application. The geolocation API is standardized: http://www.w3.org/TR/geolocation-API/

Related

Port an OpenLayers application to mobile devices

After making a duration/cost estimation, I'm about to start developing a desktop application using OpenLayers. I've never had experience on it before, but have the support of some coworkers who do.
Now we have to estimate the time and effort it would take the same application to be viewable in mobile devices. I know the existence of openlayers.mobile.js, but nobody in my company has ever worked with it before.
I know it has some advantages over the normal OpenLayers library, such as pinching for zooming, and so. But, does it has any blocked capabilities? I mean, if I write code to draw a line on a layer in the desktop application, change the simbology of a layer, add a buffer arround a polyline, etc.. will it still work with the mobile library?
Is there funcionality in the desktop version that is not in the mobile one?
I'd need to know before estimating what can I offer in the mobile version, and how hard will it be to get so.
See examples tagged with mobile:
http://dev.openlayers.org/examples/
The next OpenLayer versions will probably have better mobile support as this is something many users are interested in.

How to mimic the user experience of native application while building for cross mobile?

I'm building an application which I intend to deploy to iphone, android and blackberry. There's a unique characteristic I've noticed about my blackberry bold 9700, which uses an optical track pad for maneuvering around the screen. As an experiment, I deployed a simple phone gap application to my blackberry. I used the optical track pad to move a "small arrow cursor" around the screen to select and click on elements. When I compared my experimental app to some of the other native blackberry applications on my device, I noticed that none of them use this "small arrow cursor". Instead, sliding my thumb across the optical track pad will cause a "hi-light selector" to jump from one available link/button/field/image/list-item/tab etc... to another. This "hi-light selector" is much faster and user-friendly than the "small arrow cursor".
Now I need advice on the best technology to achieve the following:
I would like to write one set of code for an application to deploy to
iOS 4+ , android 2.2+ and Blackberry OS6+
On android and ios devices, you can simply scroll and touch buttons
for call to actions. On blackberry, I would like to replace the
"small arrow cursor" with the "hi-light selector".
I would like to use slide screen effects on android and ios devices.
On the blackberry, I would need a good substitute.
So my question is: Is there a practical way for a solo developer to achieve all the criteria above? If not, then what is the closest I can achieve to the criteria above? And what mobile javascript library would be best for the job[1]? Or do I really have to consider building with native technology (obj c for ios, java for android, java for bbos)?
I've only looked at sencha touch and didn't see anything relevant to the "hi-light selector".
I'd take a look at Appcelerator:
http://www.appcelerator.com/
... and ...
iUi:
http://www.iui-js.org/

Most widely used Mobile app development technology

In mobile development world, which is the best programming language/technology that we can use so that almost the same code that will run on all versions. I know it is little bit of a broad question and the most probable answer is Java. If I want to provide support for maximum number of devices(android, Iphone and other high end classes only), how many different code bases I should have?
Thanks,
GL
[...] that we can use so that almost the same code that will run on
all versions [...]
All modern mobile smartphones / devices support HTML 5 / CSS / Javascript.
PhoneGap Augments these basic tools with the rest of the functionality you'd need.
Projects like jQuery Mobile are gaining a lot of traction as well.
I'd start there.
I wouldn't say it's "The Most Widely Used" technology... at least not yet... but I have a hard time believing anyone wouldn't agree things are going that direction.
UPDATE: For anyone who hasn't seen PhoneGap before - this (free) product will take your HTML / CSS / JS, and package them up inside a native application (which includes some shims to startup your app, and augment it with access to camera / files / gyro / etc from javascript). Your app works offline, and can be deployed through all of the available standard app stores.
If it's a web app, then you can develop using a highly adaptive layout, HTML 5, CSS, and the JS library of your choice, and you'll be fine.
If you are running native apps, you're pretty much stuck: Java for Android, Objective-C for iOS.
Regarding HTML5/CSS3, even if it is possible to reuse 90% of codebase (mostly non-rendering JS), there are significant differences when it comes to graphical presentations. Even, if you think that because Androids and Iphones use Webkit, so they should have roughly similar capabilities, they are quite apart.
Just to give a few examples: CSS3 3D transforms are mostly not supported on Android phones (Android 2.3), Audio tag implementation varies between Android and Iphone (Androids do not use buffering and streaming, while Iphones do).
And just do not get me started on how Androids lie about dimensions and aspect ratio. It is a bloody mess.
We have not tested latest Windows mobile phones, but until IE10 is shipped, support for HTML5 in windows world is abysmal.
To conclude, currently, there is no technology, "that we can use so that almost the same code that will run on all versions." HTML5 is 'almost' there, but will take perhaps a few years for Androids to catch up and Webkit to get the required speed and functionality to be able to compete head-on with native apps.

Which platform is used in companies now-a-days to implement mobile applications?

Basically i would like to know which platform is currently used to develop mobile applications i.e. J2ME etc etc...
Also any new ideas on mobile applications would be quite helpful.
Generally, the approach is to go for a website, if possible, and adapt it to each phone using a 'device detection layer'. We use DeviceAtlas.
If you want to write native applications for each phone, then you need to do it in each of the native languages (and there are a lot).
Symbian/Java: Greatest 'penetration'
iPhone/iPod Touch: Latest trend, objective-c for this.
Android: I think this is a variant of Java, and will be a very marginal component of the market for a long time, though maybe high among a certain type of techies.
Basically, you are going to need to profile your market, and determine the best approach. But as I said, in general, you'd prefer a website, and mostly, a website is all you need.
There is a framework called Rhodes by Rhomobile that allows development of native applications for all major smartphones. See my answer to a similar question earlier this year.
We are primarily targeting the iPhone, but don't always make an iPhone-specific application. The web browser on the iPhone is good enough that a lot of our web apps just run there ok. So many of the apps we're writing continue to be done using the same platforms we've always used. We're a big institution so this runs the gamut from J2EE and .NET to Php and Ruby.
Mobile-only apps are developed in XCode (or web versions in DashCode).
If you need to cover multiple mobile (esp. smartphone) platforms, Javascript (with HTML and CSS) may be the only way to go, despite all its limitations. You get under the radar of Apple's iPhone app vetting, it's the only way to target Pre, you can also cover Blackberry, Android, Windows Mobile, AND Nokia on a single codebase... unless the limitations are just TOO stifling for your specific purposes, it sure seems like the way to go!

Mobile Devices Advice

I would like to develop on a mobile device, probably with Windows Mobile platform, which device would you guys recommend for me to use? But one requirement on the device is that I need that device to be able to capture signature (human writing on the device).
Many Thanks
Sounds like any PocketPC (or "Professional") device would do. Personally I currently have an HTC Touch Pro, which would be suitable for what you describe. For testing purposes, it might also be a good idea to also test on a device with smaller resolutions (I have an HTC Elfin for example that would do well here, but it shows its age..). Or on the emulator provided with the SDKs.
However some of the newer ones have capacitive touch screens and no stylus. (For example HTC HD2.) So while HD2 is otherwise an excellent phone, capturing a human writing on it probably wouldn't work as well as older devices with resistive screens and a stylus.
Any Windows Mobile 6.0/6.1 based phone with resistive touch screen. A good example is HTC Touch Pro2.
Also, some S60 5th edition phones, such as N97, may be a good choice.
It depends on the languages you intend to use to write the application.
If it's Java, I'd go with an android system.
If you're a c# coder I'd say any windows device would be ok.. You could likely get one on EBay for dirt cheep and for the most part you can be sure your code will run on most of them (I know this is a generality), especially if you keep the code simple.
If you're a c++ developer then the same as above, any pocket PC/winmobile will do.
If you own a mac, and you've written apps in objective c then IPhone is a good choice.
In part you have to base decisions like this on what you know going in.
If you're a blank slate.... well then you've got to figure out what direction you want to take your knowledge. I've personally picked Java and Android because I've recently been convinced it's the road to the future.

Resources