Android App to access AppGini

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Android App to access AppGini

Post by sathukorala » 2020-07-05 13:41

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>


User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Android App to access AppGini

Post by a.gneady » 2020-07-07 19:26

That's cool ^_^ Thanks for sharing!
So, to clarify, all you need to do is to put the app URL into this line?

Code: Select all

webView.loadUrl("YOUR PUBLIC URL");
And then compile with Android Studio?

I could consider adding an option to generate the manifest files as part of the generated code if there is enough demand for it :)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Android App to access AppGini

Post by D Oliveira » 2020-07-08 13:40

a.gneady wrote:
2020-07-07 19:26
That's cool ^_^ Thanks for sharing!
So, to clarify, all you need to do is to put the app URL into this line?

Code: Select all

webView.loadUrl("YOUR PUBLIC URL");
And then compile with Android Studio?

I could consider adding an option to generate the manifest files as part of the generated code if there is enough demand for it :)
yes please do it, if possible also adding the iOS option, my clients are creating a crazy demand for that! Check out corona sdk, they have a multi-platform easy integration, the tricky part is just managing aspect ratio of devices.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Android App to access AppGini

Post by jsetzer » 2020-07-08 14:46

Hi @DOliviera,

thanks for sharing your experience on corona application. I have registered, downloaded, installed and created a blank project.

There are 26 files in that blank project. Most are PNG-image files. There is a config.lua and a main.lua. Where do I have to put the code line you have mentioned?
webView.loadUrl("YOUR PUBLIC URL");
Thanks in advance!
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Android App to access AppGini

Post by D Oliveira » 2020-07-08 19:21

Hey Jan, just edit main.lua

follow this simple tutorial: https://docs.coronalabs.com/api/library ... bView.html

Code: Select all


local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
webView:request( "http://www.coronalabs.com/" )
-- or
webView:request( "localfile.html", system.ResourceDirectory )


User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Android App to access AppGini

Post by jsetzer » 2020-07-08 21:07

Thanks, @DOliviera, I got it running in CORONA SIMULATOR on Windows 10 (64).

For deploying as Android App there is Oracle JDK required. Since April this is not free any longer for professional use. Is there a free way to build an Android app?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Android App to access AppGini

Post by D Oliveira » 2020-07-08 23:33

yeah its a free source project now, you should be able to publish it for free!

https://github.com/coronalabs/corona

https://forums.solar2d.com/

sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Re: Android App to access AppGini

Post by sathukorala » 2020-07-08 23:47

a.gneady wrote:
2020-07-07 19:26
That's cool ^_^ Thanks for sharing!
So, to clarify, all you need to do is to put the app URL into this line?

Code: Select all

webView.loadUrl("YOUR PUBLIC URL");
And then compile with Android Studio?

I could consider adding an option to generate the manifest files as part of the generated code if there is enough demand for it :)
Thanks Ahamed for the appreciation.
Yes its only that line you have to edit
But I agree that Android Studio is for advance users and its a bit complicated. But it's totally free and legit.
Flutter is an option to do this for iOS. I will update that too

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Android App to access AppGini

Post by jsetzer » 2020-07-09 05:41

D Oliveira wrote:
2020-07-08 23:33
yeah its a free source project now, you should be able to publish it for free!
Sorry for the misunderstanding, I was not talking about coronalabs product, but I was talking about the required Oracle JDK, which it not free since April 2019 any more.

Is there any free alternative?
Did you test with and open Java version?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Android App to access AppGini

Post by D Oliveira » 2020-07-09 11:36

Sorry for the misunderstanding, hmm in that case you might wanna use corona just for the iOS build and follow this topic's tutorial for an android version, sorry couldn't find a better answer to this issue


User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Android App to access AppGini

Post by baudwalker » 2020-07-14 07:13

Thank you for that, I installed the app but when I ran it I get "Loading Interface" it has be loading for the past 20 minutes.
Any Clues?

sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Re: Android App to access AppGini

Post by sathukorala » 2020-07-15 12:10

baudwalker wrote:
2020-07-14 07:13
Thank you for that, I installed the app but when I ran it I get "Loading Interface" it has be loading for the past 20 minutes.
Any Clues?
Have you checked the internet access to the app?
It means app is working but the connection is the problem

sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Re: Android App to access AppGini

Post by sathukorala » 2020-07-15 12:23

baudwalker wrote:
2020-07-14 07:13
Thank you for that, I installed the app but when I ran it I get "Loading Interface" it has be loading for the past 20 minutes.
Any Clues?
Ok I have removed the loading prompt
Get the new app from the below link

http://www.mediafire.com/file/et8a8rezg ... 2.apk/file

User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: Android App to access AppGini

Post by baudwalker » 2020-07-28 22:52

Sorry for the late reply, you know how things are, lot to do...

I got your latest version to work and it works quite well. I found that the responsive design of the HTML code produced by Appgini also works well. The feedback from some of the 15000+ users report that HTML loads much quicker and runs much smoother than the Android App.

Having said that I believe it is good to know that there is a way to produce an Android App.

Thank you for your assistance in giving me a chance to investigate this method.

Barry

xbox2007
Veteran Member
Posts: 129
Joined: 2016-12-16 16:49

Re: Android App to access AppGini

Post by xbox2007 » 2020-07-29 00:02

thanks you very much
i use your code but i was face some problem , and get Two Error

1- net::ERR_CACHE_MISS
i add this line on AndroidManifest.xml

Code: Select all

<uses-permission android:name="android.permission.INTERNET"/>
2- ERR_CLEARTEXT_NOT_PERMITTED
i add this line on AndroidManifest.xml

Code: Select all

android:usesCleartextTraffic="true" >

i fix with edit this code on AndroidManifest.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.alhanfy.appgini01">
   <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:theme="@style/AppTheme"
        android:usesCleartextTraffic="true" >
        <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>


Thanks a lot

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Android App to access AppGini

Post by grimblefritz » 2020-07-29 12:16

It would be useful -- for those whose only exposure to Android development would be the download and installation of Android Studio, and whose only interest would be to create an Android app to access their web app -- to publish a step-by-step on how to use these three files with Android Studio in order to generate a usable apk. Without having to learn anything about Android development or Android Studio.

For someone like me, that is :lol:

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: Android App to access AppGini

Post by grimblefritz » 2020-07-30 16:48

If anyone is interested, I found it much simpler to use this:

https://appsgeyser.com/

No need to download and install Android Studio, deal with manifest files and java code, etc.

Create a free account, and in a few steps you can create a free app.

Select, Create App

Select, Business (not Individual)

Select, Business Website

Follow the prompts and the rest is easy.

When finished you can scan a QR code and load the app straight to your device.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Android App to access AppGini

Post by hubert » 2021-02-07 21:39

Hi A gneady,

Sure would appreciate this option, did you work on it ?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Android App to access AppGini

Post by a.gneady » 2021-02-11 22:35

hubert wrote:
2021-02-07 21:39
Hi A gneady,

Sure would appreciate this option, did you work on it ?
You mean the option to convert an AppGini app to a mobile app? We're currently working on an API plugin for AppGini ... I think this would pave the road to building mobile apps later. Stay tuned!
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Android App to access AppGini

Post by hubert » 2021-02-15 11:19

Ok thx in advance, good work, keep safe !

Post Reply