develop a phonegapp application - android

I am trying to develop a phone gapp app but I find the documentation a little confusing.
As far as I understand, I can just write my app, choosing any directory layout I want except that index.html and config.xml need be on the first hierarchy level and then zip it and upload it to PhoneGapBuilder.
It says on the website of PhoneGapBuilder that I should leave the reference to the PhoneGap.js but remove the PhoneGap.js files from my project.
My question is: Where do I get that PhoneGap.js file? Do I download it from the apache cordova github repo?
Most tutorials show how to make an app using XCode or Eclipse, however, I want to use PhoneGapBuilder to be independent of any IDE and platform.
Where exactly do I get the necessary files to just start developing a phonegap app on my computer, with my editor of choice, using xampp and the ripple emulator?

Why do not you give a try to build.phonegap ?
This "build" platform is far easier for newbies than installing Phonegap and so on.
Once, you read 1 or 2 pages documentation or even if you do not read and just modify the mock up config file you will be able to convert HTML5, CSS projects to mobile apps.

Related

Import phonegap/cordova project into Intel XDK

I am a programmar at novice level.
I have a project that I would like to import at Intel XDK.
Link to the project
The project structure has been made in Phonegap version 2.1.
I am trying to inport the HTML5 project within Intel XDK with no luck.
I'm getting the error : index.html is missing!
Do you know if there is a way to get this project work into Intel XDK?
The html files are under the directory of assets/view. But there is no index.html.
Hope you guys could help me figure this out.
With friendly regards,
Mirjam.
The easiest thing to do would be to use a blank template to create a new project and then copy your www directory from your existing project into the www of that blank template project.
It's not clear which of your html files is the equivalent of index.html, but you might want to just re-use the index.html file that is created by the template as your index.html file and work from there.
Just a note, in general, it is hard to build multi-page hybrid apps (like yours appears to be) if you are going to be using APIs that are implemented via Cordova plugins. If you do not need any of the Cordova plugin APIs (that is, you are only using standard HTML5 APIs that are built into the webview), then you can get away with it. If you do plan to extend your app to take advantage of Cordova plugins (core, XDK or third-party) you might want to consider creating a single-page app.
Another approach to consider is displaying the "other" pages using the inAppBrowser plugin. This assumes that the "other" pages do not need access to device APIs.
It's hard to provide a precise "here's how to do it" without having a deeper understanding of how your app is structured and where you intend to go with it.

Is there a way to find out which tool was used to create a mobile app?

I am getting started with mobile apps development, but there are so many tools available to develop cross-platform apps, so I am really curious as to what was used to build certain apps.
Basically I would like to know if there is something like PEiD, but for mobile apps, or if there is an easy way to find out what was used to create a certain app I've downloaded from Google's/Apple's App Store (i.e. some sort of file or information inside the apk file).
EDIT
After searching a bit more I found this, which may work in a few cases: decompiling DEX into Java sourcecode
For instance, I decompiled one game that I had on my Android smartphone (and on my iPad) and found Cocos2d framework inside it.
Some cross platform tools let the programmer use web technologies (HTML, CSS and JavaScript) so then they can load these files into a WebView. If you were to dump the View hierarchy using DDMS you will see a WebView on it.
Having said that, the point of these frameworks is to generate the same end result as a native app, so I doubt there will be metadata somewhere in the .apk.

How to go about native packaging with PhoneGap for a simple one page application?

I have a simple one page web application. Due to some reasons, my client wants to package this as a native app for iOS and Andriod. This application does not intend to use any of the device's capability (such as camera etc.). It just needs to be packaged so that it runs on the mobile device as a native app rather than the browser.
My question is if I use PhoneGap to package this app, can I simply upload the zip file as is on phonegap and download the packages for these devices? Or I would need to go through the process of creating phonegap app?
You have to follow some process for it. You have to add config.xml and make some changes in it as per your requirement. And nothing else.
Make zip file of your HTML, CSS, Config.xml.
Refer Phonegap Build Documents

Set up Phonegap with eclipse

I went through some documentation regarding Phonegap. Coming from an Android background, I wanted to try out phonegap so that I could develop multiple-platform apps relatively fast, however I am uncertain on a specific point. Is it possible to install phonegap on eclipse and code a multiple-platform app from there? Or do I have to stay installing xcode, visual basic etc and coding for every one?
Can someone kindly indicate what the best practice is in this situation?
Check out this link :
Integrate Phonegap with Eclipse
That will show you step by step process.
if you want to use the same code for multiple platform then you have
to upload the code which is under www folder to Phonegap site.
They will provide you multiple builds directly. Or if you proceed
separately like Android above then you have to generate separate
builds with separate ides available like eclipse for Android and xcode
for iphone.
Thanks.
When you will download PhoneGap that will be included with an example just import that example & run that example in eclipse & go through all the files available in that Project . So that you will understand that which files you have to put where & how .

can I develop android applications using gwt?

(or is there a way to convert gwt apps to android apps?)
It is not entirely correct to say that GWT is meant to create code that runs in a browser. GWT translates Java to Javascript and includes ui support and other goodies for web apps. There are a few native application wrappers that take Javascript applications and make them native for Android (or other mobile operating systems) with additional support for device access through Javascript apis. With a glue layer in between GWT and a native wrapper for a Javascript app you have a complete solution from GWT programming to native app.
So, you cannot do this with GWT alone but if you combine GWT with some other libraries it is absolutely possible.
Checkout PhoneGap/Cordova and either m-gwt or GWTMobile. NextInterfaces is built on top of PhoneGap and GWT-Mobile. I'm sure that there are more, but those seem to be the common solutions.
If you want to develop native Android Apps (i.e. written in Java) then you cannot use GWT. GWT is a framework for developing applications that run in a browser: you write your application in Java and GWT will compile it to JavaScript, which will then run in the browser.
If you want to develop web-applications that work in Android's browser, than you can most definitely use GWT. Native support for touch events was recently added to GWT and there are others who are developing widgets, e.g. http://code.google.com/p/gwt-touch/
GWT apps are executed through a browser, but if you want to develop native Android Apps with the same code, take a look at PlayN. It's quite limited but the resulting app will work on a browser, Android, iOS and desktop
GWT is cross-platform and works on WebKit based browsers, like those in iPhone and Android. GWT Mobile WebKit, might be of great help to you.
However there seem to be some issues with Scrolling using GWT in Android while it is seem to be fine in iPhone
Here these are the steps to create android app from gwt app
Compile the GWT project. Right click on the project, select Google-> GWT compile and select the project. It will take some time till it gets compiled. The new stuff is created in war directory in that GWT project
Than create new Android Project let’s say GwtTest.
Create libs folder if not generate automatic and paste the phonegap.jar (0.9.4 or above), I used phonegap-1.2.0.jar
Add the jar file on project’s Build path
Copy all generated stuff from GWTProject/war directory to GwtTest/assets directory (gtwproject, WEB-INF, css and html file)
Now in android project’s MainActivity, extends DroidGap instead of Activity. Remove setContentView line and add this line: super.loadUrl(“file:///android_asset/index.html”);
In Manifest.xml file add line of internet permission:
uses-permission android:name=”android.permission.INTERNET”
Create xml folder in res directory, put cordova.xml and config.xml file into the xml folder. Now you can run GwtTest as Android Application.
Remember the apk that will be generated while run as android, the size of apk is around 35mb. So make sure that your android device has this enough size.
Since GWT is Java a lot of your code can be reused on Android. However, some code such as the UI can't. Google inbox reuses 70% of it's gwt code on android.
Look at this question too
if you want to develop the app that would run in the browser and android (and few other platforms on the way) you could use playN

Categories

Resources