Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: qaximor on October 16, 2014, 02:34:14 am

Title: [Tutorial] How to create android mobile app for your Osclass website!
Post by: qaximor on October 16, 2014, 02:34:14 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 (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!
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: cyrano on October 16, 2014, 04:17:06 am
That's great!

Would this also work with Android Studio?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: qaximor on October 16, 2014, 12:56:53 pm
Yes of course!
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: bengalliboy on October 16, 2014, 02:57:42 pm
What about a native apk for android? Going to mysql directly??
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: creat15 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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: qaximor 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.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: creat15 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  :)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on October 28, 2014, 01:04:14 pm
sdk manager icon not shown  :( :(
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 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?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on October 29, 2014, 10:30:20 am
 :(
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 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 (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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on October 29, 2014, 12:14:14 pm
can u help me with teamviwer ?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on October 29, 2014, 12:59:54 pm
have you opened Eclipse and tried to run the sdk manager from there?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 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??
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello 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 ?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 02, 2014, 03:55:45 pm
@Hello
If you don't know how to open eclipse, then this tutorial is not for you, sorry
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on November 02, 2014, 10:24:06 pm
i mean there is not a applcation icon
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 02, 2014, 10:28:41 pm
See enclosed, if its not there, then you havent got it downloaded, and installed properly
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 02, 2014, 10:29:35 pm
PS, got this working fine now.! Many mins of patience!!
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: qaximor on November 04, 2014, 09:02:27 pm
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 (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

What errors are you getting? Make sure you change the package name to whatever is yours.. and check if the name of your MainActivity.java file is MainActivity or MyActivity (Android Studio calls it MyActivity by default) so check for the changes that you have to make.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 04, 2014, 09:22:48 pm
 ;)
see reply#19
all good, i had set up a new app with multiple actions, when i needed a blank action to start off with!
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: bengalliboy on November 05, 2014, 01:00:42 pm
@aide2001
How does your UI looks? Can you share some pic of your apps look and flow chart?
Also is it available to download and try? If so how and where?
Are you directly getting the data from server via the webservice or are you saving to a local db and then displaying to user?
Thanks
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 05, 2014, 01:35:33 pm
@bengalliboy
Yes you can download it directly from playstore
its a little more difficult for blackberry, and near impossible for itunes, especially as apple want $99 before you even begin!
I was going to do an app for the Windows phone, but that's a nightmare too!.
So google play is the only one so far search for bikersbay and you will see.

At the moment it's direct from the webserver, but intime, i'll be uploading to the data locally every night. So you dont have to be online.

Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: bengalliboy on November 05, 2014, 01:40:29 pm
aide2001
I don't see on google play. What is the link? Can you make it downloadable from US? Or is it restricted for your country only. If so can you share some screen shots please
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 06, 2014, 10:56:33 pm
I've put it into the USA market, but they say it may take several hours to take effect
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: pixellegolas on November 10, 2014, 12:26:18 pm
"bikersbay does not need any special permission"...I like that :) Compared to other apps that want to take over my whole phone :)

Seems to work pretty good. Well done
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 11, 2014, 06:02:33 pm
Cheers. Why take over your phone, its just an app !!
Thanks for trying it.
Spread the word.... ;)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Zacdaniel on November 12, 2014, 03:24:28 pm
This is epic will give it a go and see
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 13, 2014, 06:16:25 pm
I found the other day that on the net you can change your app from apk (android) to bar files (blackberry)
pretty cool, so you can get your app to work on android and blackberry using the same files !!
Just apple to bash through
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: creat15 on November 14, 2014, 06:20:16 pm
hi :)

i want to ask, how to show icon android if user post listing from app android (example : my user created listing from my app android, and , in the post listing show icon android)

and how to not show icon android if user posting from computer, laptop, or any device. (example : my user created listing from computer, laptop or any device other than "android", in the post listing icon android not show)

(maybe this script for website theme, not script android?, example for item.php to show this icon).

i search on google nothing, and what keyword for this?

this my icon android

and this link for example this (http://www.olx.co.id/iklan/smartfren-andromax-i-new-fullset-76071408.html#pn_62f8882b1de48f479ffbe2e0a450cd42)

thanks before
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: mladja04 on November 14, 2014, 11:35:01 pm
I've put it into the USA market, but they say it may take several hours to take effect
Can you give us name of application to try it. Thank you
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on November 15, 2014, 03:41:51 am
Pls make a video tutorial.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: creat15 on November 15, 2014, 06:08:28 am
please help, for this answer  :-[

hi :)

i want to ask, how to show icon android if user post listing from app android (example : my user created listing from my app android, and , in the post listing show icon android)

and how to not show icon android if user posting from computer, laptop, or any device. (example : my user created listing from computer, laptop or any device other than "android", in the post listing icon android not show)

(maybe this script for website theme, not script android?, example for item.php to show this icon).

i search on google nothing, and what keyword for this?

this my icon android

and this link for example this (http://www.olx.co.id/iklan/smartfren-andromax-i-new-fullset-76071408.html#pn_62f8882b1de48f479ffbe2e0a450cd42)

thanks before
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on November 17, 2014, 06:19:01 pm
I've put it into the USA market, but they say it may take several hours to take effect
Can you give us name of application to try it. Thank you
Bikersbay is the app name, cheers
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Hello on November 21, 2014, 12:26:05 pm
got error
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Genius-Tek on January 22, 2015, 03:25:22 pm
hello
I would understand,  use a translator to communicate with you, I would like to optimize my osclass Thema for smartphones,
  with this software you can optimize the thema,
there is a video guide to better understand the operation,
  thanks in advance for your answer
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: mladja04 on January 31, 2015, 03:00:39 am
I've put it into the USA market, but they say it may take several hours to take effect
Can you give us name of application to try it. Thank you
Bikersbay is the app name, cheers
Thank you. You close application in Google Play for some countries?
Because it isn't available for my country.
I try to install it in my phone to test it.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: safeacid on February 26, 2015, 04:03:08 am
Hello.is it possible to insert this in google market?
Have you done it?
Can you show example how it will look ?
Thanks
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on February 26, 2015, 01:04:04 pm
I've put it into the USA market, but they say it may take several hours to take effect
Can you give us name of application to try it. Thank you
Bikersbay is the app name, cheers
Thank you. You close application in Google Play for some countries?
Because it isn't available for my country.
I try to install it in my phone to test it.
Where are you in the world and i will include it to that country
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on February 26, 2015, 01:07:16 pm
Hello.is it possible to insert this in google market?
Have you done it?
Can you show example how it will look ?
Thanks
Dont know about google market only android play market
Yes Ive done it to play market
See attached
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: rethus on February 26, 2015, 07:49:22 pm
Isn't there a way to create an App, which got the needed Stuff like "Target Website" via a config-file?
In this case, everyone could easy and fast get an app running for his forum.

BTW: Is it possible with this app to act on a osclass-installation, which behind a .htaccess-Password request?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: bengalliboy on February 26, 2015, 11:23:29 pm
@aide2001 did you use the osc mobile theme for it? Your one looks hybrid app. Correct?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on February 27, 2015, 12:24:31 am
hi @bengalliboy i'm using the OSC Mobile theme, but had some serious issues with the default version of it, so much so i basically had to redesign it then, I set up an app to redirect to the mobile site. (ps mobile site loads pretty quick)
Hope this helps 8)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: rethus on February 27, 2015, 11:14:27 am
Did that means, you have a switch for Desktop and Mobile view? Or did you only use the mobile-theme?
Would be great to have some suggestion from you, how I could run both, desktop for browser, and mobile optimized one.

At the moment I use bender, it seems to be responsive... does the mobile-version better than the bender-responsive one (with loading time)?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 on February 27, 2015, 01:13:41 pm
Yes @rethus
Its has a switch to desktop if need be, which is also responsive, but runs slow for mobiles, due to the heavy weight of javascripts image sizes etc.
You can run both on your site.
It will auto detect mobile/tablets, and the user can choose if they are on tablet to goto desktop view.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: bengalliboy 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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: aide2001 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..
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: jimzubemo on May 29, 2015, 11:52:50 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 (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/ (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.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy 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 :)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: FAd on July 15, 2015, 04:50:14 pm
pls, where can I find this "activity_main.xml" file?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim 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;
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy 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/
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 16, 2015, 08:15:34 pm
pls, where can I find this "activity_main.xml" file?

app\res\layout\activity_main.xml
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim 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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: FAd 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!
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy 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 :)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim 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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy 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
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy 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?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim 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. 
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 19, 2015, 07:38:23 pm
File i was trying to upload was too big, 10MP camera *firstworldproblems* :)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 19, 2015, 07:42:46 pm
Still it doesnt work from the app. When i installed Mobile View plugin (forgot its name) it worked. Is it because of the theme i'm using (Next Revo)?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim on July 19, 2015, 09:06:36 pm
Lol, how I like to have the the *firstworldproblems*, file size can be set on php.ini configuration. Actually the original suggestion was to use the mobile plugin if you read the thread from the start, so it might be the theme.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 19, 2015, 10:11:28 pm
But mobile plugin is so ugly. Isnt there a way to fix this, mb copy code from said plugin and just replace it for mobile wersion of the theme? Its just i'm totally noob in php and programming in general.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: ephraim on July 19, 2015, 10:24:10 pm
For sure it can be, but you have to learn css responsive design for you to benefit on that, otherwise the easier solution should be to change your theme, but its not a guarantee that it would work 100%, I just tested it in 2 browsers firefox and the default android browser it worked for those. On the app itself it's detecting chrome as my default browser unfortunately in Chrome uploading doesn't work.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 19, 2015, 10:25:56 pm
Ah, so trouble is with chrome, is there any way to force created app to run other kind of browser?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 20, 2015, 01:11:02 am
Is there a way to make andriods "back" button go to previous page instead of quitting this application and mb add "To top of the page" button on the right bottom?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: FAd on July 21, 2015, 05:57:04 am
Thanks so much for your responses, I really appreciate you!
But can you help me with the Andriod Studio setup (software)?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 21, 2015, 02:48:58 pm
What i did is install Andriod studio, Andriod SDK manager (dont remember if it was seperate or came in with the studio). Then downloaded everything in SDK (cuz i didnt know what i needed) and in the end it all worked out :)
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: FAd on July 23, 2015, 01:26:43 pm
Pls, am I going to install this android studio on my Personal computer or on my site?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Billy on July 23, 2015, 02:56:45 pm
PC ofcourse
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: FAd on July 26, 2015, 05:34:36 am
Thanks Billy!
I will try that.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: jimzubemo on September 29, 2016, 01:06:42 pm
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 (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!


Great...But does the image upload works with the Android App?
In my case it doesn't.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: jimzubemo on September 29, 2016, 01:08:14 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.

Same issue here.
I created an Android WebView App for an OSCLASS website with responsive design. So the app opens the website and it looks good. I can even post ads from the app BUT WITHOUT PHOTOS. The Image upload button is not responding. The image upload works on Android browsers - both default android browser and Google Chrome.

Does any one know how to resolve it?

I have also checked this with another Android WebView app for a Drupal website and it also does not work. So this may not be a OSCLASS issue but an Android WebView issue. Nevertheless, if anyone has solved this image upload issue from android webview app, please share.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: Loriby87 on October 27, 2016, 10:30:22 pm
Drag and drop button is not working and when i can`t go back to previous page.anyone can help me?
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: chobienmau_com on April 21, 2017, 01:35:21 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.

I have the same error. How to fix.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: indiakom on March 25, 2019, 01:28:23 pm
Hello i want to know about database structure and tables as well so that i can make android application of that website. So kindly tell me what i can do now? I don't want a webview i want to make new android  application of that website.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: herwincamargo on June 30, 2019, 02:14:11 am
I'm facing the same issue, the upload image feature is not working! Any fix?

Thanks in advance.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: WEBmods on June 30, 2019, 03:42:24 pm
This code here works great: https://www.zidsworld.com/uncategorized/make-android-webview-support-file-upload/

I ain't Android dev expert and I can't write full code, but I used the example on the URL for one of my apps and it was working.

Regards.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: p206ab on July 24, 2019, 10:16:47 am
For all who have problems with image upload, use this: https://github.com/mgks/Android-SmartWebView

Just import this project inside your Android Studio and edit the URL to your page. It has all features you need, including Camera access, GPS, Splashscreen... easy to edit to your preferences and design.
Title: Re: [Tutorial] How to create android mobile app for your Osclass website!
Post by: WEBmods on July 24, 2019, 12:55:17 pm
For all who have problems with image upload, use this: https://github.com/mgks/Android-SmartWebView

Just import this project inside your Android Studio and edit the URL to your page. It has all features you need, including Camera access, GPS, Splashscreen... easy to edit to your preferences and design.

I found out this thing recently. It is really awesome and easy to work with. :)

Regards.