How exactly does Sencha Touch wrap the native app? - android

When I compile my web app to a native iOS and Android app, how will it work? Will it be a regular web view that runs my app, which is in my server? Or it will place all the images, HTML and CSS files inside folders in the app project on Xcode and read them locally?

The latter. It will copy all files to the device, and run a webview which will load from the local directory. Think of it like you have some web files on your PC and point your browser to localhost to access them. It will load all the local pages/images even when offline, but you will face errors connecting to external resources unless online. Plenty of web apps are made without ever touching the developer's servers, also many times a simple restful solution will suffice.

Related

Android application using html

When you say android application I understand its a .apk executable. But When you say developing android application using html, does it mean we still get a .apk file or when we develop using html, is it then called as android web development, which means you won't get a .apk file. But you get a html file that runs on android browser. Is that a correct statement. Because apart from Java and C# Xamarin which will produce a .apk file, I dont think html--->.apk file never happens.
So .apk file means apps similar to windows applications, and using html means we
create a mobile web application?
does it mean we still get a .apk file or when we develop using html
It can, if you are using tools like PhoneGap.
or when we develop using html, is it then called as android web development, which means you won't get a .apk file
An HTML5 Web app, particularly with offline caching, can feel a bit like an app. However, it would be written as a Web site or Web app and distributed as such, not distributed in the form of an APK.

HTML5 Android Phonegap Web app not working offline with cache manifest

I have a simple web app built with Phonegap and Android that call external ressources (js, css, html) from server instead of storing it in Phonegap assets folder. I prefer using external ressources because my server can deliver html pages taking in charge internationalization.
This web app work fine on my android device when WIFI is on but it fail when stopping WIFI. My index.html file delivered by my server contain a valid manifest file with correct mimetype ('text/cache-manifest') that list every files the app need to work.
My Android Activity class is supposed to have caching enable:
this.appView.getSettings().setDomStorageEnabled(true);
this.appView.getSettings().setAppCacheMaxSize(1024 * 1024 * 15);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
this.appView.getSettings().setAppCachePath(appCachePath);
this.appView.getSettings().setAllowFileAccess(true);
this.appView.getSettings().setAppCacheEnabled(true);
It may worth mentionning that my app use ajax call with urls like /aaa/bbb/ to call web pages from server and I don't know if that may be the problem (l'm not calling physical pages directly like index.html)... However, this web app work well in desktop browser (Google Chrome) when offline...
Any idea what more can I do to enable this HTML5 cache feature on my Phonegap app?
Thanks a lot
After playing around for a while I get it to work. Here is some points you should verify when stucked with this type of caching problem:
Take care about url parameters passed with GET method... I was passing parameters when navigating between pages of my app and those parameters was making my urls different from the ones in manifest file making cache to fail.
When testing offline mode on my phone, I was only shutting down the WIFI thinking this was enough to trigger cached version of my app but it was not... As I was testing my app published under a local network IP (like 192.168.2.11), it appear that my app was trying to reach that IP trough the 3G network that was still ON... So use airplane mode when testing offline.
Not sure if this one was necessary as I read it on some others threads but I renamed my manifest file to cache.manifest.
Regards
Apparently you need "to fix the Android Shell Native App to enable HTML5 caching".
If you haven't already, please check out: http://tmkmobile.wordpress.com/2012/03/04/html5-offline-solution/
I am developing a similar system. What I did was I created the Phonegap webpages and stored them in the www folder of my WAMP server. Then what I do is I basically super.LoadURL("insert_ip_address_here/insert_name_of_folder_where_webpage_is_located") in the onCreate method and this loads the phonegap application perfectly (yes all you need is just only line of code in the Android app itself). However you still have to make sure that the config.xml, manifest and all configurations needed for phonegap are properly done (for instructions on this see https://www.adobe.com/devnet/archive/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html).
Let me know if this the path you choose to pursue. I can provide extra support with things like making the ip-address (in the line super.loadurl(...)) dynamic for the local system using multi-casting, etc.

Using SVGZ files without a server. (Local iOS/Android)

I'm working on the UI for an Android and iOS app. It will likely be built with PhoneGap (or the like) meaning the UI will be an HTML5 implementation.
For most of the images, we've decided to go with SVG files as they scale well across the various Android screens and are great for Retina on iOS.
So far, using .svg files is working fine for us and thanks to Safari and Chrome support, easy to test locally in a standard browser.
The catch is that these .svg files are going to get rather large as we turn them into sprites. As such, I'm looking into using GZIPped svg files (.svgz).
A quick test shows that a 50k SVG we are using compresses down to 8k via Gzip.
The catch, however, is that it appears that there needs to be a client/server relationship going on to decompress the SVGZ file. I can't get Safari to render the linked .svgz file when run locally (as I assume it will be when via a webview in a PhoneGap compiled app). Chrome appears to be able to render the svgz, though.
So, my questions:
Is there any way to use .svgz files locally on iOS via a PhoneGap app (I haven't gotten to the point where we're compiling via PhoneGap yet so can't test that part at this time)?
Any known issues with .svgz on Android (given it seems OK on desktop Chrome)?
Should I even be bothering with .svgz in this situation where there aren't actual download speed concerns (outside the initial app download)?
I don't know much about issues with svgz on either iOS or Android, but you definetely shoudln't worry about the size of the .svg files compared to .svgz, not even for the initial download. All the files in an Android and iOS packages are compressed anyway, so zipping those files yourself won't bring you any gain. It might actually be better for your app performance-wise to keep them un-compressed.

Android web application on cloud storage

I have a cloud storage website and I want to create an Android application for that website.
I tried 2 methods.
First Method
Using Phonegap to open a remote website which handles everything and its built-in PHP so everything works fine. But a Cloud Storage app must allow uploading and downloading. In Phonegap I can upload through the website but can't download directly to local storage. It can only be done locally if my website is in the local www folder. Also in this way API of Phonegap can't be used either. If I download any file the browser opens up, in this case.
Second Method:
I tried to use Phonegap locally and just create an API of my cloud storage website so that locally with the help of jQuery ,Ajax so that I can post data to the remote URL, but that can't be done due to the Same Origin policy. I may receive the JSON data of files and show but can't log the user in and other features. :( Again a problem.
What else can I do? Is there any other method or solution you can provide me regarding these two methods or any alternative method I can use?
Depending on the kinds of data you're talking about there are several alternatives.
You're describing a cloud storage app (I'm assuming like drop box or Google drive right).
Therefore you'll want to write to the file system instead of some kind of database (locally ofc)
I would therefore check out the following api docs;
http://docs.phonegap.com/en/2.1.0/cordova_file_file.md.html#File
Examples are there too.
PS ive had same origin problems in development, but they seem to go away in production, try testing there too.

How to play local video files in a browser

Am looking for the way to play video inside my android browser locally. There may be two or more video's in a local page (like facebook contains video's).
Can anyone please help me out..
Without actually reading about the specifics of the Android built in browser I would safely say, you can't. Well, if you run a local html file it might work, but if you intend to have an external page from which you can play local videos it shouldn't work. I say shouldn't because in the early days of browsers some of them actually did give you access to the local file system. Javascript for example could use file://, something I used myself for image previewing before upload. But this was a major security concern and all modern browsers prevent this.
The difference is if you run a local file or a file on your own local web server. Since then, your local file system is actually part of the web servers file system and the web server can serve your local files.

Categories

Resources