PhoneGap android page navigation - android

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.

Related

Embed react native app inside existing android app

I want to create a page made with native android with a small portion (say a horizontal scroll view) made from react-native inside the same android page like an android page with a react-native widget plugged in, such that the app is completely widgetized.
I know that it is possible to do so because I read about it in this article and some companies are using it.
Can anyone help me how to achieve this?
My question is same to this question, I found a few useful articles related to this matter for iOS but I want a solution for android.

How to create a web application which works for both web browser and android app

I have a little knowledge in developing web application.
but I need to explore something like application which works in web browser and android app.I have idea that how both works separately.
1. Web application
2. Android App
but i don't have an idea how to code for application which works in web browser and android app.
Whether I need to code for both separately or there is any method or technology to work with it.
If so help me out with a simple Example .. or reference.
The concept you're looking for is called "Progressive Web App". I can't tell you how it works becase it would be a full tutorial. However, I can point you in the right direction.
Take a look at:
https://developers.google.com/web/progressive-web-apps/
https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/
You might also want to:
https://developers.google.com/identity/sign-in/web/android-app-installs
Good luck on your learning jurney.
Let me know if this was what you were looking for.

Does pages in an hybrid app gets converted to activities

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.

Is it possible to create an android app with full HTML design?

I want to know if it's possible to design my android app UI with HTML5 and CSS3.
If it's possible, is there any performance issue?
Android has WebView which can render HTML content, but it doesn't provide the same user experience as native apps so its use is generally discouraged.
Yes it possible. As rhoadster91 stated, you can use a normal Android WebView which loads your "index.html". All your HTML files should be in the "assets/www" directory. But you'll find plenty tutorials out there which explain everything step by step. Have a look at Googles developer site.
A second possibility would be Phonegap. It is a little tool which helps you to deploy your app for various devices (Android, iOS, WP,...) while coding your app only once in HTML.
I experimented with jquery mobile, native application and phonegap. Building a web application at first seemed very attractive at first as the coding is a lot easier compared to native applications. Here is my opinion based on my research:
Using phonegap slows your application responses, it loads slowly and together with jquery mobile the response and load time increases. So I didnot use it.
Using jquery alone was no different in Gingerbread mobile and on emulator you can clearly see the lag in switching between one div to another div. I didnot use it either.
What I did was use android Webview. I wrote my own javascript and css and placed them on the head section of my page. Used div for changing pages on button click. This approach worked really good giving nearly native performance.

Android - HTML5 custom LAUNCHER

I want to create my custom android launcher but not with java code. I want to create it with HTML5 code. I've seen some launchers with HTML5 but not the documentation. Does anyone can give me some links or some tutorials/documentation to start? Thanks.
Does anyone can give me some links or some tutorials/documentation to start?
You could define much of the UI as HTML/CSS/JavaScript. Via PhoneGap, you could deploy this as an app. However, you will still need Java code -- or perhaps a PhoneGap plugin, if someone has written one -- to be able to access information about the installed apps, in order to populate your launcher.

Categories

Resources