i am starting to make a game on android using phone gap. i want to switch between different layouts (like to change activities). as there is no activity in phonegap it extend Droidgap. any answer will be appreciated :)
PhoneGap basically uses Android Webview to display all activities. Just create different HTML pages and make links between them, you should then be able to navigate among all activities.
Related
I just started developing mobile app with phonegap.
I want to check the best practice in maintaining screens.
Is it possible to have only one activity and navigating screens with html's.
If so is it correct practice?
Besides, when we need to maintain activities and corresponding html's on t top of them.
navigating screens with html's means using WebView and act like a browser?
If the project is small and you are the only developer, Yes. Can have only one activity. and navigate through various fragments is possible. but not very recommend. One of the reasons is, with only one activity make it difficult for team work.
I know it might sounds generic question but i need to know something about hybrid app.
I have a hybrid app developed using cordova framework, it has multiple pages(html divs).
Now, my question is does each page gets converted into an activity when i compile it(specific to andriod).
Thanks in advance
Your app will consist of one Activity only, which consists of a webview. In this webview your html content will be loaded. You can probably tell that the page transitions of your app differs from the native Android page transitions.
I would like to inquire if it is possible to embed an Android app in a pre-existing app?
Basically, the parent app will have a set of tabs. Clicking on each tab will open a third-party app within the tab activity. I will access to the third party's apk files but not their source code.
Please advice if this is possible in Android or not.
You don't need to embed the applications, but you can use startActivity or startActivityForResult to launch other applications.
No you can't embed activities in other activities. You can use fragments to do the same thing, but it sounds like that's not what you want.
I am a newbie to Android development and was using PhoneGap to develop a simple application. Can anyone please answer the below questions?
In all the sample applications found in the internet, they use a single index.html file. How to develop an application in phonegap containing more than one page?
How can we navigate from one page to another?
I want to have the same code to work in iphone also, so if I create more than one activity will the same code work in Iphone?
Sorry, it was a dumb question and since I was new to phonegap development I had no idea what I was doing.
The problem was that at the beginning I considered it like developing an android application. If you consider it like developing a website, you will find that the answer is very simple.
So for example, in my home page I provided two anchor tags which will point to my webpages which will handle the other two functionalities. ie. In my sample application to create and list profiles, the homepage would look like this.
< a href="addProfile.html" style="styling for the anchor to look like a button"/>
< a href="listProfile.html" style="styling for the anchor to look like a button"/>
We use JavaScript to navigate between all of the pages we have in our application, navigating within a frame.
And yes, if it works in PhoneGap, it should work in both Android and iOS.
I'm planning a project which will uses JSON objects to display data on andorid mobile.
My application is some what similar to facebook application for android. It seems making detailed ui like facebook's like,comment will be time time consuming & webview seems to be better option in this case ?
need your suggestion.
I'm also planning same app to be developed on iPhone as well.
Refrence link
Android has enough support for JSON that you can easily use the native widgets for your application. By using native widgets, the Joe Default user will have a more normal (expected) user experience, since most of the application will work just like any other Android application works.
Another thing to take into consideration that by using native widgets, it will probably be easier to add support for different UI sizes (portrait and landscape mode in various sizes can be a pain to get right in a single webview).