Advertisement:

Author Topic: [Tutorial] How to create android mobile app for your Osclass website!  (Read 30596 times)

qaximor

  • Newbie
  • *
  • Posts: 15
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
Code: [Select]
<?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.
Code: [Select]
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
Code: [Select]
  <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!
« Last Edit: October 16, 2014, 02:00:10 pm by qaximor »

cyrano

  • Newbie
  • *
  • Posts: 34
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #1 on: October 16, 2014, 04:17:06 am »
That's great!

Would this also work with Android Studio?

qaximor

  • Newbie
  • *
  • Posts: 15
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #2 on: October 16, 2014, 12:56:53 pm »
Yes of course!

bengalliboy

  • Full Member
  • ***
  • Posts: 204
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #3 on: October 16, 2014, 02:57:42 pm »
What about a native apk for android? Going to mysql directly??

creat15

  • Full Member
  • ***
  • Posts: 218
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #4 on: October 16, 2014, 07:57:55 pm »
Hi :)

nice tutorial :)

i want to ask, I've tried the tutorial of your work but on the uploaded image to the new ads can not, how to be able to upload an image from android?

then how to keep uploading images of android can choose an image from the camera or gallery

qaximor

  • Newbie
  • *
  • Posts: 15
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #5 on: October 17, 2014, 09:02:57 pm »
Hi :)

nice tutorial :)

i want to ask, I've tried the tutorial of your work but on the uploaded image to the new ads can not, how to be able to upload an image from android?

then how to keep uploading images of android can choose an image from the camera or gallery

It should work as it would in a normal browser of a phone. I tried uploading from my app and it works perfectly.. I have no idea how to fix your problem, sorry.

creat15

  • Full Member
  • ***
  • Posts: 218
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #6 on: October 18, 2014, 09:06:38 am »
Hi :)

nice tutorial :)

i want to ask, I've tried the tutorial of your work but on the uploaded image to the new ads can not, how to be able to upload an image from android?

then how to keep uploading images of android can choose an image from the camera or gallery

It should work as it would in a normal browser of a phone. I tried uploading from my app and it works perfectly.. I have no idea how to fix your problem, sorry.

hi :)
thanks for replying, yes I have a problem in the input file, and the following is the input code file that I use:

Code: [Select]
<input type = "file" name = "Photos []" accept = "image / *" capture = "camera" />

but it does not work, if anyone could help me?

thanks before  :)

Hello

  • Full Member
  • ***
  • Posts: 174
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #7 on: October 28, 2014, 01:04:14 pm »
sdk manager icon not shown  :( :(

aide2001

  • Guest
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #8 on: October 28, 2014, 05:55:28 pm »
This sounds very interesting and will give it a shot, currently i have an app made by a third party to do just this, but has their ad plastered all over, so I will give this a shot.
I take it you just set up a new android app in the java ADT and just save it as an APK file?

Hello

  • Full Member
  • ***
  • Posts: 174
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #9 on: October 29, 2014, 10:30:20 am »
 :(

aide2001

  • Guest
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #10 on: October 29, 2014, 10:53:16 am »
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
Code: [Select]
<?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.
Code: [Select]
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
Code: [Select]
  <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!

Yep, didn't work, loads of errors come up when loading this into the ADT, ah well, worth a shot, i think its because it loads a blank template with all the imports already inlcuding package name, i think i just need to play with myview.load url part

Hello

  • Full Member
  • ***
  • Posts: 174
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #11 on: October 29, 2014, 12:14:14 pm »
can u help me with teamviwer ?

aide2001

  • Guest
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #12 on: October 29, 2014, 12:59:54 pm »
have you opened Eclipse and tried to run the sdk manager from there?

aide2001

  • Guest
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #13 on: November 01, 2014, 12:46:34 pm »
Yeah, its still not working for me I get a blank page saying
Unfortunately my site has stopped working.

This might be down to this line
import com.example.esouqbh.esouq.R;

Maybe more examples??

Hello

  • Full Member
  • ***
  • Posts: 174
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #14 on: November 02, 2014, 11:44:31 am »
have you opened Eclipse and tried to run the sdk manager from there?

where i open eclipse ?