TUTORIAL: disable shortcut home screen Android

As what have probably brought you here. When you install an application from the Google Play Store a shortcut is added to your Home screen. Is it Handy? I don’t know.. I’ll leave that up to you, but 9/10 times I do not want a shortcut on my start screen.


Tutorial: disable shortcut home screen Android

Lets follow the next steps to disable shortcut on the start screen.

  1. Go to apps
disable shortcut android
disable shortcut android

2. open Play Store

shortcut home screen android
shortcut home screen android

Click on the hamburger menu next to Google Play. See the image below:

shortcut android
shortcut android

4. Scroll down and open Settings

shortcut home screen Android
shortcut home screen android

Find “Add icon to Home screen” and uncheck the box.

disable home screen android
disable home screen android

The next time you’ll install an app it wont be added to your home screen. If you do want an app on your home screen open apps > hold the app and move it to the home screen.

The image below shows you how to add an app to your home screen.

disable shortcut android
disable shortcut android

Do you regret removing this option? Just check the box next to “Add icon to Home Screen

After you install an app from the Google Play store, an icon will appear on your home screen for you to easy access the app… but if you install quite a few apps you the apps will add up and eventually make your home screen full with apps you barely use.
With the steps I provided you can disable the shortcuts from automatically being placed on your home screen.

TUTORIAL: Change your website into an Android App

WHY WOULDN’T YOU USE AN APP GENERATOR?

We could use an app generator yes, but don’t you want to create your own app and earn the revenue yourself? Appsgeyser is one of the best, I got to give you that. Yet it isn’t that hard to create your own website app!

I created my own app with Appsgeyser. The problem was that they want some of the revenue & also had their own menu in my app. I don’t blame them for that of course, that’s how they get their money.

Anyway, I did some researching since I really wanted an app. I found out I couldn’t create an Iphone app on a windows device.

Change website into App

Change website into app

Don’t use an app generator!

We could use an app generator yes, but don’t you want to create your own app and earn the revenue yourself? Appsgeyser is one of the best, I got to give you that. Yet it isn’t that hard to create your own website app!

I created my own app with Appsgeyser. The problem was that they want some of the revenue & also had their own menu in my app. I don’t blame them for that of course, that’s how they get their money.

Anyway, I did some researching since I really wanted an app. I found out I couldn’t create an Iphone app on a windows device.

But with the Android Studio it was actually easier to create an ‘In-browser app’ to go to your Blog then I thought it would be.

This tutorial is for Android Apps only.


before we start

Before we start we going to need a few things.

Change website into App
Change website into App

Now you’ve installed the Android Studio and Java Development kit we can start.


Guide: Change website into App

Open Android studio and follow the screenshots.

Click on file > new > new Project.

Change website into App
Change website into App
Change website into App
Change website into App

Give in an Application name, Company Domain, and Project location.
Select the form factors your app will run on.

The API 19: Android 4.4 (KitKat) is necessary to be able to create your app. minimum sdkYou can pick a ‘blank Activity’. The Adsense revenue you have on your blog will also be shown in the App. blank activityLeave the ‘Customize the Activity’ the way it is. It will be easier for you when you’re doing some research. main activity with menu


this was the easy part… now we’ve got some coding to do!

At the left of android studio you’ve got the content of your app.

From the Android Development page:

  1. src/main/java. Android Java source code.
  2. src/main/res. Resources used by the native application.
  3. src/main/res/drawable-type. Image resources used by the native application.
  4. src/main/res/layout. XML layout files that define the structure of UI components.
  5. src/main/res/values. Dimensions, strings, and other values that you might not want to hard-code in your application.
  6. src/main/AndroidManifest.xml. The manifest file defines what’s included in the application: activities, permissions, themes, and so on.
Turn website in Android app
Turn website in Android app

Open the directories like I did. The AndroidManifest.xml, Mainactivity, and Activity_main.xml are the files we will be using.

Double click the files and click Select the ‘Text’ tab at the bottom of the of the activity_main.xml editor to see the XML markup.

In the XML pane, remove the self-closing slash from the end of the FrameLayout element, and add the <WebView> element and a new closing tag, as shown:

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

Here you can see how I did it:

Change website into app
Change website into app

To use the WebView you need to reference it in the Activity. Open the MainActivity.java 

App > Java > Application name >  MainActivity.java 

Add the following lines:

private WebView mWebView;
mWebView = (WebView) findViewById(R.id.activity_main_webview);

Make sure you add them like I did: Private Webview mWebView; before the first @override

And add the mWebView = (WebView) findViewById (R.id.activity_main_webview); between the { } Like this:

    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);
 
    }

After adding the code, you’ll see some warning messages in the margin of the editor. This is because you haven’t imported the right classes for WebView. Luckily Android Studio can help you fill in the missing classes. The easiest way to do this is click and hover over an unknown class name and wait for a popup showing a “quick fix” — in this case, adding an import statment for the WebView class.

Remove the following line in the MainActivity.java 

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
    return true;
}

This is how it should be now; Do not copy this! it will fail because it’s a differen project!

package com.baswijdenes.testproject;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {

    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();



        return super.onOptionsItemSelected(item);
    }
}

WebViews don’t allow JavaScript by default. To run a web application in the web view, you need to explicitly enable JavaScript by adding the following lines to the onCreate method:

Add the following line to the MainActivity.java 

// Enable Javascript
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

Your  MainActivity.java should be like this:

    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);

// Enable Javascript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);

Oké we’re done with the  MainActivity.java file. go to the AndroidManifest.xml.

If you’re going to load data from a remote URL, your application needs permission to access the internet. This permission needs to be added in the application’s manifest file.

Here we only need to add  one line.

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

Add the line between </application> and </manifest> like this:

    </application>

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

</manifest>

The next step and last is to call the loadUrl method on the webview. Add the following line to the end of the MainActivity.java @override.

mWebView.loadUrl("https://www.baswijdenes.com/portfolio/");

Add it like this:

    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);
        mWebView.loadUrl("https://www.baswijdenes.com/portfolio/");

// Enable Javascript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);

we’re done… or not.. do you use https with a 301 redirect? Stay tuned…

If your website is using http, please scroll to the next chapter.

If your website is using https with a 301 redirect the app will constantly ask you if you’d like to open the Smartphone browser.

Add this line to the MainActivity.java 

// Force links and redirects to open in the WebView instead of in a browser
mWebView.setWebViewClient(new WebViewClient());

Your MainActivity.java should look like this:

    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);
        mWebView.loadUrl("https://www.baswijdenes.com/portfolio/");

// Enable Javascript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);


        // Force links and redirects to open in the WebView instead of in a browser
        mWebView.setWebViewClient(new WebViewClient());
    }

Lets continue.. adding an image to your app

You want your app to have a fancy image, don’t you?

Go to File > New > Image Asset

image assetThe Asset Studio speaks for itself, Click on the 3 dots and pick an image.

You can also play with the Additional Padding, Foreground Scaling, Shape, and background color.

asset studio


last but not least, lets generate an apk to upload to your google play development

If you did everything I told you to do, we don’t need to run your app and test it out, but if you still like to, click on Run > Run ‘App’.

Creating the APK goes as following

Click on build > Generate Signed APK

build app

If you click on ‘Create new’ first you can fill in the extra information for the ‘New Key Store’.

Generate Signed APK New Key Store

Don’t copy mine text tho..

Give in the master password one more time.

Turn website into app
Turn website into app

Your APK file will be generated now and a network drive will be opened up.

Upload the ‘app-release.apk to the google play development.

Do not lose the keystore(jks) file! You cannot update your app if you don’t have this file!!

And of course I have generated an app as well find it in the Google Play Store!