First Android application.
Traditionally if you wanted to build an application for Android, you had to install a set of programs on the desktop computer. Doing so could cause a majority of problems. Now there are Android application environments now for direct use on Android such as the Nexus 7. Such an application is called AIDE (Android integraded development environment).
You can get Aide directly from Google play and download it directly ot your device. Now lets build a simple hello world program. Everyone's first program is usually the "Hello world" thing. This will be a different experience from the days of:
$ gcc progname.c -o progname
or
$ ./config
$ make
$ sudo make install
1. Get AIDE. It can be downloaded from the Play™ store.
2. Open up AIDE and it will ask to create a new project.
AppName: HelloWorld
PackageName: com.meetdageeks.HelloWorld
3. Goto MainActivity.Java and add the three lines (without the comments!).
And you can check it from the installed apps lists.
Written from the same Android that created the project.
Note You still can develop html, javascript. and css applications without a compiler.
You can get Aide directly from Google play and download it directly ot your device. Now lets build a simple hello world program. Everyone's first program is usually the "Hello world" thing. This will be a different experience from the days of:
$ gcc progname.c -o progname
or
$ ./config
$ make
$ sudo make install
1. Get AIDE. It can be downloaded from the Play™ store.
2. Open up AIDE and it will ask to create a new project.
AppName: HelloWorld
PackageName: com.meetdageeks.HelloWorld
3. Goto MainActivity.Java and add the three lines (without the comments!).
package com.HelloWorld; import android.app.*; import android.os.*; import android.view.*; import android.widget.*; public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main);
//<<<<<<<< Add these three lines <<<<<
TextView text = new TextView(this); text.setText("Hello World, Android"); setContentView(text);
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
} }
4. Click the 3 dots (or dashes) in the top right and hit run. It may ask you to allow installation from unknown sources. Done!
And you can check it from the installed apps lists.
Written from the same Android that created the project.
Note You still can develop html, javascript. and css applications without a compiler.
Comments
Post a Comment