How to create an APK of a HTML5 to run on Android - android

I know that those kind of questions have been asked before, but I couldn't find a topic to help me.
I have been give a HTML5 game and I was asked to verify if I can run it on an Android tablet.
I'm a little bit confused with what I have to do? Should I create an Android project and import the file or is there an easier way to create an apk?
Thanks for your help.

You could look at Apache Cordova. This is a powerful environment made to support app development in HTML5. As such you should be able to literally copy your game resources over, run a build and have a full fledge Android App. Fun fact, provided you have access to OS X, Cordova will produce an iOS compatible app too.

If your game consists of HTML, CSS and JavaScript, such that it can be run off a modern web browser with no special plugins installed, rest assured it can run in an Android tablet.
You could access it directly from the tablet's browser or you can make an app (packaged in an APK and installed from it) which does essentially the same, but with a great benefit: the web page and the app can communicate (via JavaScript), enabling a richer experience.
Example of such communication: you're making an app for a web forum, and the link for "compose new message" opens an Android activity for writing that POSTs the result to the server, instead of constraining you to write in a small web browser form.
For more information on the subject, check out Android API Guides for Web Apps.

Related

mobile simple application, drag and drop

i didn't want to ask a question, but i don't have any solution at all.
i've not seen such a kind of problem. i decided to write applications on mobile platforms (android and iOS), but nothing found.
lots of tutorials and documentations
lots of samples
lots of libraries and frameworks
but nothing found... i'm fed up, still looking for difference between mobile web application and desktop. i wanted to write simple drag and drop calculator, searched and found phonegap + jQM. first, i installed eclipse + ADT + cordova and created project. when i started writing, i decided to use jQuery (cause i needed drag and drop effects), and suddenly found that i needed applaud plugin and so on... as i understand applaud app and native phonegap app are differenet. when i searhed, i found that phonegap + jQM are web apps and needed NET to start application. I don't want to write web app, i only want 3 - 4 line to undestand what' going on... what is difference between web and client app in mobile and how i can write simple drag and drop calculator NOT WEB. i'm really fed up with these tutorials and documentations, i only need correct starting way and then i will do myself. damn, i'm tired...
A web app is an HTML5, JavaScript, CSS app running in a mobile browser typically published on a web server but can be run locally on a device without a network connection in some cases.
A native app is downloaded and installed on the mobile device and must be published to an external app store of some sort. There are also hybrid apps that combine both characteristics.
Native and hybrid apps have more complete access to the device platform and can be more performant than web apps but require more specialized language skill (Objective C, Java, C#).
Web apps can be as simple as a web site displayed on a mobile device and require much more broadly utilized skills such as HTML, JavaScript, and CSS.
The requirements of your drag and drop calculator are not specified but I would suggest that a very simple web app could meet your needs.
This IBM article might be overkill for you but it also happens to discuss the offline web app option. http://www.ibm.com/developerworks/web/library/wa-offlineweb/index.html

Is PhoneGap the right choice for me?

I am new to PhoneGap, and I have several questions:
I need a way to develop an application that will have iOS, Android, and other platform compatibility. In other words, I want to write 1 app and get compatibility versions for different platforms.
By reading the "Get Started" guide linked by the PhoneGap website, I found there are different procedures for different platforms. So to have compatibility versions across platforms, do I have to go one-by-one and change all of them if I make a modification to my app?
Also, what exactly is PhoneGap Build? It seems like I can avoid all that hassle mentioned previously and toss my app into the PhoneGap Build? Do I really not have to do anything besides writing the app? What if I need to make changes?
And finally, I've read that PhoneGap works with HTML, CSS, and Javascript, but not PHP. What if my app needs to contact a server? Can PhoneGap handle that?
Thank you for bearing with all these questions!
PhoneGap achieves platform compatibility by embedding a webview within your application. Therefore you can apply your knowledge in HTML, CSS, JavaScript and it additionally provides ways to interact with native features (e.g. camera, gps, ...).
With PhoneGap you write one general web app, tweak parts for the specific platform (sometimes you do not have to this at all) and build it for that platform. The latter can be handled with PhoneGap Build service: It takes your webapp and bundles it for the mobile operating systems out there (Embeds it within a Java app on Android, an Objective-C app on iOs)
PhoneGap is able to communicate with a server hosting a PHP script just as every other web application. Trying to dynamically load resources from remote sites can be quite a hassle but this is another question.
traumalles is correct. All your HTML/Javascript/CSS is running from within a webview on the device. Your code is, therefore, all "client-side." You can communicate with a server just like with any other page. When they say PhoneGap isn't compatible with PHP, they mean only that PhoneGap can't execute PHP code like it's a server, because it's not. It's just loading your webapp in, basically, a browser.
One other important question is what exactly do you mean with "other platforms" phonegap does provide many functionality for nearly every platform but the different webbrowser of the mobile devices have their problems and limitations.
For example are there many problems if you want to provide your application on a WindowsPhone Device because the Webbrowser has a few limitations which will cause your app to not look and behave like a native app.
Just look a bit through the phonegap API you will see that some functions are just available for IOS or for Android and there are a few only Blackberry methods and so on.
So you really have to be careful when a framework tells you it will work on all devices.
So i really don't have a problem with phonegap i worked with it very great but there will be limitations you have to deal with.
If you primarily want to develop for IOS and Android you can really achieve great native like results !

phonegap development environment

I'm trying to get setup to do mobile development using phonegap so i can deploy my application in android store and apple store. It's my understanding that I can simply wrap my application in phonegap so I can deploy for Android, iOs, BB, etc.
My application is an ASP.Net MVC app written with VisualStudio. All of the examples I've read through in my research tells you to use Eclipse for PhoneGap and Android, use XCode for PhoneGap and iOs. My app is ASP.Net MVC that produces Html 5. Is it possible to use PhoneGap with VisualStudio to produce Android and iOS deployable phonegap apps?
One alternative I've been thinking about is creating a simple Index.html page that uses jQuery to make a call to my ASP.Net MVC app and load the resulting HTML inside a div. Then I can simply reproduce this very lightweight Index page in Eclispe, XCOde, etc to run through Phonegap. This seems like a hack though. I've tried getting this to work but have not had any luck in the Android emulator in my windows environment.
Can someone please point me in the right direction for how to incorporate PhoneGap with my ASP.Net MVC app? Thanks.
ASP.NET lives on your server, so anytime you reference any ASP.NET script, you'll have to make the URL an absolute one with a hostname: http://www.example.com/my-script.aspx. Any non-dynamic files should be stored locally on the device so they will function when there is no network connection. You can then just host the dynamic files on your server and reference them whenever you need to. To keep data transfer size as small as possible, I generally pass JSON or something similar to the app. from my server-side script and then interpret the data into HTML in the JavaScript code for the app.
You should keep as many assets as you can local on the device so it doesn't require an internet connection to use the app. So don't link to a remote version of jQuery, save it as a part of the app. package you create so it's always available.
Eclipse/Xcode are nice because they help you create your app. and package it properly for submission to app. stores. They are also nice because of how easy it is to find help using Eclipse or Xcode to create apps. Xcode is actually required, Apple makes sure you have bought the latest hardware and the latest software just to be able to submit an app. to the store.

Best way to deliver a website to view offline on an Android tablet

looking for some advice on what is the best way to deliver an HTML/CSS based website for use on Android tablets offline.
Having researched the topic on here for a while and looking into different development techniques there seems to be two outright 'winners' as such for delivering such a project.
Firstly, is to build the website normally and then save it to an SD Card to run in the Android browser, secondly is to use Adobe Air and run as an Android app but what I'd also like to know is whether if it is possible to browse the website online and have it cache on to the device so that when it loses an internet connection the full website will still run as normal.
A bit more info on the website, it will be built completely in HTML/CSS with responsive templates so that resolutions aren't an issue and it is a 'brochure' website so the content won't need updated at any point.
Any help on the issue is much appreciated as developing Android apps or running websites from an SD Card is something I've not had the pleasure of doing before.
Many thanks
PhoneGap is an HTML5 app platform that allows you to author native
applications with web technologies and get access to APIs and app
stores.
Say goodbye to SDKs, compilers and hardware. Simply write your app
using HTML, CSS or JavaScript, upload it to the PhoneGap Build service
and get back app-store ready apps for Apple iOS, Google Android, Palm,
Symbian, BlackBerry and more.
By compiling in the cloud with PhoneGap Build, you get all the
benefits of cross-platform development but can still build apps just
the way you like.
You can use PhoneGap and even Build PhoneGap (online version) - just upload your entire HTML5 app as a ZIP folder (local paths like /assets/ and not D:/images/) - just the full app code and zip it - then use PhoneGap - it will convert it and give you the App code file - visit Android marketplace as well as others such as Apple and upload.
done.

What tools & libraries to use for building a simple iOS and Android app using web technologies?

I would like to create a mobile app for iPhone, iPad and Android (don't need other platforms for now). I am a web developer, so building something using web technologies is great, but the end result must also be as native like as possible (the user shouldn't notice) the difference.
The application is not complex, it has a few screens with simple stuff like lists, toolbars, tab bars, transitions, etc.
I've researched a lot and the best solution so far for me looks Sencha Touch and PhoneGap.
What do you recommend?
Edit: I think that many things have changed over the last year so I think that many resources and other Stack Overflow questions ;) are old now, that's why I'm asking this.
A good option for mobile web development of simple apps is jQuery Mobile + Phonegap. If you are a web programmer, you will feel right at home. Both projects are actively developed so things are just getting better.
You first develop your app in a browser (Webkit, e.g. Safari) and then use Phonegap to put this web app on a mobile device.
Android
For creating Android apps, you don't even need other tools, you can just upload a zip file of your app to Phonegap Build (an online service) that will compile your app into an .ipk file, which you can just upload to Google Play! Easy.
iOS
For iOS it is a little harder, but still manageable. Here, Phonegap have created an iOS project, which you can open in Xcode, then drop your files in and publish the app to App Store. The process is harder, since you have to first take care of all the developer certificates, provisioning profiles, etc., so be prepared for some hair pulling!

Categories

Resources