It's really easy and you don't need any prior Java or Android development knowledge.
What you need is:
Eclipse
Java SDK
Android SDK
(I won't be getting into how to download and install them, please look for a tutorial on the internet there is a lot of them trust me!)
Mobile Plugin from the Plug in market to force mobile devices to go to the mobile version and if your theme already has mobile version supported then you don't need to install it.
So what you need is 3 codes to copy and paste, THAT'S IT.
First code you need to past in your activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@android:style/Theme.NoTitleBar"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none"/>
Second code you need to paste in your MainActicity class (Don't forget to edit your package name above! If you are not sure just copy paste as it is and then ALT+ENTER and eclipse will edit and write your package name.
package YOUR_PACKAGE_NAME_HERE;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.example.esouqbh.esouq.R;
public class MainActivity extends Activity
{@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar as we already have it in the web app
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Point to the content view defined in XML
setContentView(R.layout.activity_main);
//Configure the webview setup in the xml layout
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
//Yes, we want javascript, pls.
webSettings.setJavaScriptEnabled(true);
//Make sure links in the webview is handled by the webview and not sent to a full browser
myWebView.setWebViewClient(new WebViewClient());
//And let the fun begin
myWebView.loadUrl("http://YOURWEBSITEURLHERE.com"); }}
NOTE: change http://YOURWEBSITEURLHERE.com to your website URL.
Third code you need to paste in AndroidManifest.xml is
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
Paste it right before </manifest>
Guess what? That's it! You just made your Osclass website into an android app!
Hi,
I also tried to create an Android App for OSCLASS website using WebView in Android Studio.
I am using Bender Theme and It works. BUT, the image upload does not work. Javascript is enabled.
I wonder, because WebView is supposed to work just like a normal Android Web Browser.
So, what I would like to know is if you were able to upload images using the App?
I also tried creating Android App using APK Creator (
http://apkcreator.frankwebstudio.com/), they have an Android App on Google Play to create apps for Websites.
In this case, every thing works, including the Image upload. But the thing is they put their credits, so I prefer to make my own.
I was wondering if you can help with some inputs to resolve the image upload not working.