Creating offline android app using Phonegap and associated memory limitations - android

We have a very strong base of iOS apps and salesforce running at the backend. I am trying to get the similar app running on Android but using PhoneGap (not going native).
I had few questions about this:
Does PhoneGap put any limitation on how much RAM can be used for an
app? If yes, how much?
Our iOS apps tend to consume upto 100MB of memory when multiple views and data are loaded in the app, is this feasible using PhoneGap?
CORE data gives me a nice GUI to design my local storage, how can that be achieved in Android?
Is there any way I can import the exact data model from iOS to android?
I spent quite some time searching this but did not get any satisfactory answer. All your help is much appreciated.

PhoneGap doesn't put any limits on how much memory is used. If there are any sort of memory limits it would come from the OS itself.
If you can build it as a website, you can build it with PhoneGap. The only thing to watch out for is if you don't manage your DOM structure you could actually crash the WebView, but if you manage it well you should be fine.
Unfortunately with PhoneGap, especially with offline apps, the only two options you have are localStorage and Web SQL.
AFAIK there is no way of exporting the data model to Android that would be usable with PhoneGap. The closest would be to go though and try to recreate through one of the storage options I listed in 3 that are supported and well documented with PhoneGap.

Related

Developing in Android Studio versus Framework (e.g PhoneGap)

I wanted to get a more experienced opinion on something I recently found out. A couple of months ago I set a goal to build myself a mobile app, and the first thing I did was go to developer.android.com and begin reading documentation on how to go about doing this.
I've invested a lot of time in understanding Android Studio and how to make simple apps (and I'm just now getting the hang of it all), but I just recently read about frameworks like PhoneGap(which let web devs who know HTML,CSS, and Javascript make apps too).
Before learning Android, I taught myself web dev through the Odin Project, which taught me a fair amount of HTML, CSS, and Javascript (little iffy on this language, but I'm sure it's something I could pick up easily since I already have a bit of experience).
I'm wondering what you guys feel are the limitations of using these frameworks and whether I should switch over to them, as opposed to continuing with Android since things are beginning to click for me.
Thanks!
I have developed apps for both Android and Phonegap. Phonegap takes advantage of your web development experience and lets you build mobile apps with ease. But it's not a replacement for Android API itself. A good phonegap application requires knowledge about web development and Android API.
However if your aim is to develop an android application, and you are comfortable with web development and Android, I would advice to take Android API.
Phonegap as wonderful as it is for web developers, and startups who can't afford to have dedicated resources for Android, iOS separately, has its limitations.
Performance : Phonegap app's performance is not at par with a native
android application.
Functionality : As one would expect you can't have all the functionality support a native android application has.
Look : You could easily tell apart a phonegap application from a native one. Given phonegap renders all the content in a webview, the look of native ui elements is lost
I think you will always need access to the native API to make good apps.
At least the navigation should be native, so that your app has the look and feel that the user expects, and so that stuff like the back button get correctly handled for you.
Even if there is some plugin that does that for you in a perfect way, I believe it's beneficial to know how Android works.
In the end, frameworks like PhoneGap add a layer inside your app rather than removing one, and it's always better to understand what goes on inside your app.
So the time that you've spent learning native Android won't be lost.
However, it makes sense to use HTML/JS if you want to share code between different platforms.
I think this article from Basecamp shows a very compelling example: https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-navigation-web-content.

Can I make an android app using html that recieves and stores values entered by the user?

Basically, I'm trying to make use of this website called PhoneGap that recives html codes and converts them into mobile applications.
So I'm trying to make an application that tells you how much money you owe people and how much money people owe you.
IS this possible?
HTML alone isn't enough to develop your application. It's a simple mark-up language and unable to create any real functionality. But HTML if used together with javascript (which adds the required functionality) will work great for building what you mentioned.
So if, for any reason, you'd prefer to not develop a standard native application (one which is installed locally on a user's device), then another option is to build a web-based application. These have much in common with typical websites (though optimized for mobile devices) and are generally easier to build. Another advantage is that they can run on almost any device that has a browser installed, and therefore not tied to any one specific OS, such as Android. Web applications - despite not being installed on the user device - can none the less make use of local storage to save data. This is one example for when javascript is needed.
Here is a great resource for learning about javascript: http://www.w3schools.com/js/
You should read about HTML5 and hybrid apps. A hybrid app is what you are after.
Yes, you can use html to build an app with Phonegap, but you'll need JavaScript too.
I suggest the following technologies for you: Ionic, Angularjs and localStorage for recording the data.

String ValuesConfiguration File in Phonegap with JQM for android

I am developing app for android using Phonegap with JQM. In J2ME app development , We can have centralized file ( message.txt ) we store list of string values which we are going to use. Like that can we have some configuration to get the string values from configuration file. So that we can easily do changes on text values. Could any one tell me.
Is it possible .?
There are numerous solutions, you only need to choose one that best serves your purpose.
Javascript solutions
All javascript solutions use localstorage as a final storage destination. Only difference is in their implementation, how far did they went to make it easier.
Lawnchair
Probably one of most commonly used JSON localstorage frameworks, also a framework of my choice. It is fast but probably a little bit confusing first time you see it. But with everything in mind it works very well.
Persistencejs
This is an another great solution. Best suited for mobile devices, but still made to work on broad specter of mobile devices (Android, iOS, BB) or desktop browsers. No matter which device is used it will use best storage available ranging from HTML5 WebSQL up to localstorage. This is an excellent solution if you want an easy way into WebSQL but it is a bit harder to work then HTML5 WebSQL.
localStorageDB
This one is a newcomer. Easy as Lawnchair but more SQL like. Like Lawnchair it uses only localstorage to store serialized JSON string. It will not work with webSQL.
Native support
Here you will also find fa few possibilities. A little bit better solution then JS frameworks, mainly because it used mobile phones native storage support.
Phonegap Storage
This is a official Phonegap support for local SQL storage. This is a commonly used functionality. But be warned it can be a little bit buggy. There's a support for every possible mobile platform except WM7+.
Cordova/PhoneGap sqlite plugin - Android version
Native interface to sqlite in a Cordova/PhoneGap plugin, working to follow the HTML5 Web SQL API as close as possible. It doesnt suffer from 5MB limit and it mimics classic SQL usage as close as possible. One thing to mention, it supports data encryption. Unlike common Phonegap Storage implementation this one supports Windows Mobile but BlackBerry is not supported.
Phonegap File
If you want to stick with files this solution is probably the best one. It is a common Phonegap solution. Store your configuration inside a XML and play with it in Java or Javascript.
Yeap, its possible to keep some string values in PhoneGap.
Since PhoneGap is based on HTML5 technology, you can make use of web storage (sessionStorage, localStorage) to store values.
Alternatively think of using native storage feature of the devices. You can store some config values in sqlite db and retrieve it when necessary.

Which approach should I take for my mobile application?

We will develop a, social network integrated mobile application which will need to access native device capabilities but 90% of the logic will be implemented in the HTML5/Javascript code posted by Ruby back end to the device. Thus, we would like to update or change the logic/GUI of the app without user involvement. We have strict deadline and have to support iOS, Android and Blackberry.
In this case, what approach would you recommend us? We considered the approaches below but could not decide since we do not have any experience with mobile development even if we are experienced in Ruby, C/C++, Java, Javascript, Flex.
Our considerations:
Develop native apps for each platform and embed the native browsers
to implement our logic, which can take too much time.
Use one of the frameworks for cross-platform development such as
PhoneGap or rhomobile. In this case, we are afraid of facing some performance issues. We would love to hear the experience of developers with those frameworks.
Use Adobe Air for accessing the device and its WebKit component for the rest.
First, I hope you understand that there is no simple answer. At this junction, having been looking at cross-platform solutions for mobile development for two years, I feel that in order to get fully native UI look, and to access all the device and UI features, one is forced to produce native application on each platform.
But, since you asked about cross-platform tools, here's a list of the main contenders:
Sencha http://www.sencha.com/products/touch “Sencha Touch is the world's first app framework built specifically to leverage HTML5, CSS3, and Javascript”
Dojo http://dojotoolkit.org “Dojo saves you time, delivers powerful performance, and scales with your development process”
Phonegap http://www.phonegap.com “PhoneGap is an open source implementation of open standards”
jQuery Mobile http://jquerymobile.com “Touch-Optimized Web Framework for Smartphones & Tablets A unified user interface system across all popular mobile device platforms”
Rhomobile http://rhomobile.com “Free and open source mobile application framework”
Titanium from Appcelerator http://www.appcelerator.com
There are plenty of comparisons online, including on SO, and this fellow actually tried to use several platforms, code included.
Anecdotally, I have seen Phonegap produce a rather iPhone-centric look, that may not mesh well with Android, plus showing performance problems when loading screens (there may be workarounds via pre-loading). Also, access to more complex devices was limited, or at least lagging. Rhomobile is a good fit for data-driven apps (simple display of large databases), but architecturally could show performance issues, so check for yourself. Personally I did not get into Sencha, Dojo seemed a little small, and Titanium showed dated architecture. So next time I'm attempting a cross-platform app, I'll give jQuery Mobile a serious try.
Let us know what you pick and how it works out.
Iam using this rhomobile rhodes for my cross-platform development App which will run in Android, Blackberry and iPhone.
We have developed application and sucessfully runned in all devices without any issues. we used ruby for backend webservice call, And remaining app is constructed with HTML5 and java Script. I didn't face any issues regarding rhomobile.
intially we faced memory issues, But later on we resolved this issue by implementing local storage for our App. For android it wont supports local storage so we used Rhom Storage only for Android Device.
Sounds like a project doomed to fail.
If I were you, I'd build a mobile-friendly site for all 3 platforms if deadline is tight. What native features do you even need, first off? If it's something like a camera, you're better off just build a native app for all 3.

Is there a big difference between coding for Mobile apps vs Web apps

I am on the cusp of recieving a new project that involves creating a mobile app for android tablets. Is there a large difference in coding for web apps vs mobile apps. And is there any good links I can go to read up on it more? This will be in .Net by the way
Well, obviously both involve coding, so they are quite similar at this level.
But the restrictions that apply to you are quite different.
on a sever application, the size of the libraries you use don't usually make a difference, while the installation size of a mobile app is a definite issue
memory and processing power are usually are less of an issue on the server, as compared to a mobile device
each mobile platform usually has it's own UI framework with quite unique concepts (at least each interesting platform does it its own way)
the APIs are quite different (it's rare to have the same API for server applications and mobile applications)
So yes, there is quite a difference between writing a web-application and writing a native smartphone application.
Fundamentally coding is coding, but as with anything you are going to be using a different language with android and a different architecture for setting things up. I would suggest reading through the developer documents at developer.android.com and depending on how well you know java maybe do some studying on the basics of java development. www.thenewboston.com helped me a ton when I was first starting to program.

Categories

Resources