Post by hellokittyr » Sun Jul 22, 2018 4:33 pm

this community is great. i have my own website now. thanks to this community.
i managed to create an app (learn from youtube), convert my site to an android app.

it only opens a page, but it's cool to have your own app to your site.
(i am not a coder, i am sure 99% of you here can do it),

I offer to build this app for ppl in here, as a way to give back. Free of charge
all you have to do it's tell me your site, the name of the app, and a icon of 512x512png

Here are the codes i used, if you want to build your own, again, i have no idea what these mean, so please dont ask me.
attached is the app i build for opencart.com
-----------------------------------------------------------------------------------------------------------------------------
activity_main.xml

<?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"></WebView>

</RelativeLayout>
-----------------------------------
Styles.xml

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
------------------------------------------------------------
AndroidMainifest.xml

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

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

<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">
<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>
----------------------------------------------------------
MainActivity.java

package com.opencart.www.opencartforum;

import android.support.v7.app.AppCompatActivity;
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("http://www.opencart.com");

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

@Override
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
} else {
super.onBackPressed();
}
}

}

Attachments

APK for opencart.com


Newbie

Posts

Joined
Thu Jul 05, 2018 3:53 pm
Who is online

Users browsing this forum: Google [Bot] and 19 guests