Android Content Framework(1)Concept

Android Content Framework(1)Concept

Some Concept

1, total customized
The Main activity will open the local html index.html page with android WebView and WebViewClient, for example
import android.webkit.WebView;
import android.webkit.WebViewClient;

Once the page is load, it will send the request as follow:
file://
sillycat://
http://

Then we handle these different protocol in our handler.

Sometimes, we will just execute our native activity.
Sometimes, load the remote URL
Sometimes, load local html page.

We can easily configure android features, we can go to remote html, local html, native codes easily.

2. jquery mobile and native sample
MainActivity load the Jquery mobile html page. Drive all the flows in the JQuery mobile.

3. PhoneGap
Based on the www static html pages. Should be able to talk to the server side via AJAX. But depends on the configuration to using native library.

And I have concerns that there is bugs or version conflicts between PhoneGap and Android/iOS.

I have no idea which one is better. I may not have enough time to maintain an Android framework, iOS framework myself. Maybe PhoneGap is a good choice.

Tips
1. Sync Error
When I sync my project with gradle on Android Studio, I get this Error Message
The project is using an unsupported version of Gradle. Please use version 1.10.

Solution:
Download and install the gradle 1.12
http://stackoverflow.com/questions/22359831/force-android-studio-to-download-and-install-gradle-1-10-or-1-1

Update the Android SDK Manager.

Update the build.gradle configuration.
    dependencies {
        classpath 'com.android.tools.build:gradle:0.11.+'
    }
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

Command to build
>gradle clean build

And one of my project is managed by maven
>mvn clean package android:deploy android:run

References:
http://sillycat.iteye.com/blog/2008402

Build Phonegap with JQuery Mobile
http://stackoverflow.com/questions/14375354/jquery-mobile-e-book-development/14375842#14375842
http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/

Customized Build It
http://code.tutsplus.com/tutorials/use-jquery-mobile-to-build-a-native-android-news-reader-app--mobile-4720
http://code.tutsplus.com/tutorials/use-jquery-mobile-to-build-a-native-android-news-reader-app-part-2--mobile-4775
http://code.tutsplus.com/tutorials/use-jquery-mobile-to-build-a-native-android-news-reader-app-part-3--mobile-4886

猜你喜欢

转载自sillycat.iteye.com/blog/2079697