Your First Android Application

by Computothought in Circuits > Computers

7034 Views, 37 Favorites, 0 Comments

Your First Android Application

android-java-ide.jpg

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.

:

$ gcc progname.c -o progname

or

$ ./config

$ make

$ sudo make install

An Environment to Develop Code.

Screenshot from 2013-07-15 02:20:51.png

Now there are Android application
environments now for direct use on Android such as the Nexus 7. Such an application is called AIDE (Android integrated development environment). You can get Aide directly from Google play and download it directly to your device.

Starting and Using the Environment.

unnamed.png

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!).

[code]

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);

//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

}

}

[/code]


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!

Downloads

Finishing Up.

index.jpeg
SUNP0025.JPG

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.

Another App to Build/

android-java-ide.jpg

Other Tutorials.

Screenshot from 2013-07-15 02:20:51.png

Htrnl, Javascript, and Css.

In progress.

Other Ways to Develop Software.

In progress.