I have an existing site (social in nature) and it already has a mobile web version too, so what I basically want to do is wrap that view in an Android app and maybe add a nice splash screen to it. So essentially a "branded" browser window.
Any advice would be appreciated.
HTML that processes HTML strings into displayable styled text and then we can set the text in our TextView. We can also use WebView for displaying HTML content. Currently Android does not support all the HTML tags but it supports all major tags.
Use the Microsoft Intune App Wrapping Tool for Android to change the behavior of your in-house Android apps by restricting features of the app without changing the code of the app itself. The tool is a Windows command-line application that runs in PowerShell and creates a wrapper around your Android app.
Most people ask that can you use HTML to make an app. Well, the simple answer to this is yes.
You would need two activites
In the main activity you would need to set a layout with a webView in your layout so something like:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
and the code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://www.google.com");
}
and the permissions:
<uses-permission android:name="android.permission.INTERNET" />
in the manifest file.
If you want to turn the title bar off you will also need to add:
<activity android:name=".Main" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
Read the docs for more help! An example for Google for this exactly and I referenced is http://developer.android.com/resources/tutorials/views/hello-webview.html
There also exist several frameworks that wrap HTML5 inside a native app and gives you access to APIs.
Phonegap is the most well-known http://phonegap.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With