Hack Scratch3.0 (3) Run as Android App (2)

It is yesterday’s continuation. We proceeded with the following procedure.

1. Install Cordova 
2. Run a hello world with cordova application on the browser.
3. Run a hello world with cordova application on the android.
4. Build Scratch 3.0 app as offline application.
5. Run a scratch 3.0 app with cordova in the browser 
6. Run a scratch 3.0 app with on the android device.

It is going to part 2 now.

What is Cordova

This time, We use Corodova to make Scratch 3.0 application to work as an Android application.

Cordova is a framework to convert into a application from wepage.

If you can use cordova, you will be able to convert your html5 application to application for mutliplatoform, ios, android, windows desktop.. etc

Let’s create an Android application with Cordova

Let’s create an Android application.

1. Download Android Studio
https://developer.android.com/studio/index.html
2. Install Android Studio
Please try downloading Android Studio
3. In Android Studio, create a Hello World
Try google with “Android Sutdio hello world”

Let’s convert a web page into an Android application in Cordova

You can now create an Android application.
Let’s run a hello world application with cordova as an Android application

1. npm install — g cordova
2. cordova create MyApp
3. cd MyApp 
4. cordova platform add browser
5. cordova run browser
6. cordova platform add android
7. cordova build android
8. cordova run android

Yes, up to 5 is what I did last time
Proceeding in order, Android application launches safely.


When you’re in trouble, you’re googling

In the majority of cases you can not build well.
I also received an error “ Error: spawn EACCES “ this time, so I could not build it.

At such times, Let’s search at Google including keywords like “cordova run android Error: EACCES” . You should find a workaround.

For example, you can find the answer as follows.
https://github.com/ionic-team/ionic-cli/issues/2835

Related