Advertisement:

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

bengalliboy

  • Full Member
  • ***
  • Posts: 204
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #45 on: February 28, 2015, 03:50:44 pm »
@aide2001
What redirect app? Can you please elaborate? We really appreciate if you can create a step by step tutorial explaining how you took the mobile theme and changed it and put it on the google play? I think this will be really helpful for every one.  Since we all have every pieces but we just need the steps to put it together. Again than you for your time and help

aide2001

  • Guest
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #46 on: February 28, 2015, 10:26:57 pm »
@aide2001
What redirect app? Can you please elaborate? We really appreciate if you can create a step by step tutorial explaining how you took the mobile theme and changed it and put it on the google play? I think this will be really helpful for every one.  Since we all have every pieces but we just need the steps to put it together. Again than you for your time and help

go back to the very first post (which i did not start btw!) and it explains it from there, before u get going would adice you to get your site on osc-mobile plugin working then create the app to redirect..

jimzubemo

  • Newbie
  • *
  • Posts: 29
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!


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.

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #48 on: July 12, 2015, 11:21:49 pm »
import android.webkit.WebViewClient;
import com.example.esouqbh.esouq.R;

I have trouble with this part, i'm new to Eclipse and installed it only for this project. Can someone please help me, I get "The import com.example cannot be resolved" and later on on my MainActivity.java "R cannot be resolved то а variable". If someone can help noob out i'll be grateful :)

FAd

  • Newbie
  • *
  • Posts: 8
  • FAD
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #49 on: July 15, 2015, 04:50:14 pm »
pls, where can I find this "activity_main.xml" file?

ephraim

  • Jr. Member
  • **
  • Posts: 80
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #50 on: July 16, 2015, 08:03:14 pm »
Tested this and it works for website with responsive layout, it's not a full app though just a launcher. Many people are asking on how to do this, you just need to read on the tutorial on how to create your first android app, and you can find all the files in your project folder. So yeah it works, I just need to remove this line from MainActivity.java
Code: [Select]
import com.example.esouqbh.esouq.R;

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #51 on: July 16, 2015, 08:14:26 pm »
Tested this and it works for website with responsive layout, it's not a full app though just a launcher. Many people are asking on how to do this, you just need to read on the tutorial on how to create your first android app, and you can find all the files in your project folder. So yeah it works, I just need to remove this line from MainActivity.java
Code: [Select]
import com.example.esouqbh.esouq.R;

Thanks i'll try/

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #52 on: July 16, 2015, 08:15:34 pm »
pls, where can I find this "activity_main.xml" file?

app\res\layout\activity_main.xml

ephraim

  • Jr. Member
  • **
  • Posts: 80
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #53 on: July 16, 2015, 09:31:09 pm »
pls, where can I find this "activity_main.xml" file?

app\res\layout\activity_main.xml

Correct

FAd

  • Newbie
  • *
  • Posts: 8
  • FAD
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #54 on: July 17, 2015, 10:35:12 pm »
thank you very much. I can't find the folder, may be because i have not install the Eclipse
Java SDK.
Pls, can someone help me with the setup software to install Eclipse Java SDK or android SDk. thank you!

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #55 on: July 17, 2015, 11:37:54 pm »
thank you very much. I can't find the folder, may be because i have not install the Eclipse
Java SDK.
Pls, can someone help me with the setup software to install Eclipse Java SDK or android SDk. thank you!
Imho dont bother with Eclips, its too much hastle, just install Andriod Studio. I had trouble with setting up some distributable files to test end result in emulated phone, esp. with HAXM. To avoid it all you can just hook your android phone (if you have one) and just test it directly on your phone. Discovered it by accident :)

ephraim

  • Jr. Member
  • **
  • Posts: 80
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #56 on: July 18, 2015, 10:19:48 am »
Android Studio has all the included plugins that is why, Eclipse is just old school lol, glad you've made it work. ;D

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #57 on: July 18, 2015, 05:24:03 pm »
I might even do quick video guide, not the installetion part but everything said in the 1st post, just in case other noobs like me have same problem :)
If anyone wants me too ofc  :P

Billy

  • Jr. Member
  • **
  • Posts: 58
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #58 on: July 19, 2015, 03:55:43 am »
When i try to upload photo from App, nothing happens when i click the button, and i get "XHR returned response code 403" when i use phone browser, any ideas?

ephraim

  • Jr. Member
  • **
  • Posts: 80
Re: [Tutorial] How to create android mobile app for your Osclass website!
« Reply #59 on: July 19, 2015, 12:19:02 pm »
Default phone browser is working though on mine @ android 4.3, app upload looks broken must be related to file permission as only full network function is allowed on the code above.