Create Android App That Acts As A Shortcut To Our Mobile Site

This is possible and fairly easy.

Your application would be a single Activity. That activity would create a new intent based on the info here on the google intents. The intent would be of type VIEW_ACTION and you'd give it an url as a value. Then you'd simply do:

onCreate(Bundle bundle){
 Intent myIntent = new Intent(Intent.VIEW_ACTION, Uri.parse("http://www.google.com"));
 startActivity(myIntent); 
}

The rest of the exercise is just wrapping that with the AndroidManifest.xml and putting it into the market.

The alternative would be to provide a webview, but, thats pretty pointless if your website is designed to function in a mobile browser already.


  Uri uri = Uri.parse("http://www.example.com");
 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 startActivity(intent);

Add to your androidManifest.xml file ..below line

<uses-permission android:name="android.permission.INTERNET" />

Tags:

Android