Page 1 of 1

Android App for AppGini

Posted: 2020-07-05 13:42
by sathukorala
This is for people who know Android Studio https://developer.android.com/studio This uses simple webview to load your app which is very useful because you need not to access any browser in your mobile device.
Yet if you don't know Android Studio this is very simple to pick up
If you really cannot do this I will help you (send me the public url for your project without any passwords) I will send you the apk file. :D :D :D

activity_main.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</RelativeLayout>


MainActivity.java

Code: Select all

package YOUR PACKAGE NAME;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        webView = (WebView) findViewById(R.id.webview);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("YOUR PUBLIC URL");

        WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
    }

    @Override
    public void onBackPressed() {
        if (webView.canGoBack()){
            webView.goBack();
        }
        else {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setMessage("Are you sure you want to exit?")
                    .setCancelable(false)
                    .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            MainActivity.super.onBackPressed();
                        }
                    })
                    .setNegativeButton("No", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.cancel();
                        }
                    });
            AlertDialog alertDialog = builder.create();
            alertDialog.show();
        }
    }
}
AndroidManifest.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="YOUR PACKAGE NAME">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Re: Android App for AppGini

Posted: 2020-07-06 06:34
by sathukorala
You can see the Appgini Demo converted into an Android App from the below apk file:

http://www.mediafire.com/file/4udbu9xli ... o.apk/file

Screenshot1.jpg
Screenshot1.jpg (74.76 KiB) Viewed 5536 times

Re: Android App for AppGini

Posted: 2020-07-06 07:26
by jsetzer
That's awesome, thanks a lot!!!

Screenshot_20200706-092217_OCMS Mobile-1.jpg
Screenshot_20200706-092217_OCMS Mobile-1.jpg (40.17 KiB) Viewed 5533 times
Screenshot_20200706-092358_OCMS Mobile.jpg
Screenshot_20200706-092358_OCMS Mobile.jpg (40.98 KiB) Viewed 5533 times

Re: Android App for AppGini

Posted: 2020-07-06 08:09
by sathukorala
jsetzer wrote:
2020-07-06 07:26
That's awesome, thanks a lot!!!


Screenshot_20200706-092217_OCMS Mobile-1.jpg


Screenshot_20200706-092358_OCMS Mobile.jpg

So happy to see it's been successful.
Thanks Jan

Re: Android App for AppGini

Posted: 2020-07-06 08:51
by jsetzer
It was a bit of a hassle to install Android Studio and fix the build errors (change package name, import R), but finally it works.
It opens up new perspectives and raises new ideas.

Re: Android App for AppGini

Posted: 2020-07-06 10:38
by D Oliveira
corona sdk has a "one liner" that will work on both iOS and Android, check it out

https://coronalabs.com/

https://docs.coronalabs.com/api/library ... bView.html

Re: Android App for AppGini

Posted: 2020-07-07 02:33
by sathukorala
jsetzer wrote:
2020-07-06 08:51
It was a bit of a hassle to install Android Studio and fix the build errors (change package name, import R), but finally it works.
It opens up new perspectives and raises new ideas.

Glad it worked Jan.
Yes it's a bit of a process to work with Android Studio because it is designed for advance users.
I can provide the Android studio package file but a new user have to install the software first.

I only wanted to open up new perspectives as now more and more mobile devices are becoming popular than PCs

New commers can test the apk file designed to run AppGini demo application in any Android device

Re: Android App for AppGini

Posted: 2020-07-14 06:11
by sathukorala
This is for baudwalker (I cannot PM in this forum because something is not right)

Find your app from the below link

http://www.mediafire.com/file/48m8uhutx ... A.apk/file