Aide is a programming source application.
Aide is integrated with c/c++ java ,xml,java SDK android studio ,eclipse ,analyzing project ,error checking etc.aide is a mandatory application for any programmer.
Let's get started .
To develop good android games you will need coding knowledge. Aide is strictly for programmers ,I find this app useful and I'm recommending it for programmers out there.
Aide is not only meant for coding,its also a tutoring app for anyone who wants to learn programming.
How to develop android apps.
Launch your aide click on android app
First learn the tutorials before start coding.
We will be using XML to develop android app.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World" />
</LinearLayout>
This will print hello world.
Why are we using XML instead if java ,let's take it step by step .
Widgets
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:text="Hi World" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:text="Hi World" />
Structure basic
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aide.trainer.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light"
android:name=".MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aide.trainer.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light"
android:name=".MainActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
layouts
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3" />
</LinearLayout>
Strings
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30dp"
android:text="Hi World" />
text-field
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:padding="20dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Compose email:"
android:textSize="20dp"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:padding="20dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Compose email:"
android:textSize="20dp"
android:layout_marginBottom="20dp"/>
Images
You can add any image you want you like.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_height="wrap_content"
android:text="Welcome to my App"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_margin="20dp" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_height="wrap_content"
android:text="Welcome to my App"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_margin="20dp" />
Buttons
package com.aide.trainer.myapp;
import android.app.*;
import android.os.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set main.xml as user interface layout
setContentView(R.layout.main);
}
import android.app.*;
import android.os.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set main.xml as user interface layout
setContentView(R.layout.main);
}
}
Option menu
package com.aide.trainer.myapp;
import android.app.*;
import android.os.*;
import android.widget.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set main.xml as user interface layout
setContentView(R.layout.main);
}
import android.app.*;
import android.os.*;
import android.widget.*;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Set main.xml as user interface layout
setContentView(R.layout.main);
}
}
when you re done coding click run and compile your work.
How to develop android games .
Goto aide menu select game and start coding .
package com.aide.trainer.mylibgdxgame;
import com.badlogic.gdx.*;
import com.badlogic.gdx.audio.*;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.*;
import com.badlogic.gdx.math.*;
import java.util.*;
public class MyGdxGame implements ApplicationListener
{
OrthographicCamera camera;
Animation walkAnimation;
TextureRegion backgroundTexture;
TextureRegion rockTexture;
Sound collisionSound;
BitmapFont font;
SpriteBatch batch;
float time;
Rectangle manPosition;
Vector2 manVelocity;
List<Rectangle> rockPositions;
@Override
public void create()
{
// Load background
Texture texture = new Texture(Gdx.files.internal("skyBackground.jpg"));
backgroundTexture = new TextureRegion(texture, 0, 0, 2048, 563);
// Load and position rocks
Texture texture2 = new Texture(Gdx.files.internal("rock.png"));
rockTexture = new TextureRegion(texture2, 25, 0, 250, 250);
rockPositions = new ArrayList<Rectangle>();
int x = 1800;
for (int i = 0; i < 60; i++)
{
rockPositions.add(new Rectangle(x, 0, 100, 100));
x += 600 + new Random().nextInt(600);
}
// Create run animation
Texture walkSheet = new Texture(Gdx.files.internal("runAnimation.png"));
int FRAME_COLS = 6;
int FRAME_ROWS = 5;
TextureRegion[][] tmp = TextureRegion.split(walkSheet, walkSheet.getWidth() / FRAME_COLS, walkSheet.getHeight() / FRAME_ROWS);
TextureRegion[] walkFrames = new TextureRegion[FRAME_COLS * FRAME_ROWS];
int index = 0;
for (int i = 0; i < FRAME_ROWS; i++)
{
for (int j = 0; j < FRAME_COLS; j++)
{
walkFrames[index++] = tmp[i][j];
}
}
walkAnimation = new Animation(0.025f, walkFrames);
font = new BitmapFont();
collisionSound = Gdx.audio.newSound(Gdx.files.internal("collision.wav"));
batch = new SpriteBatch();
camera = new OrthographicCamera();
resetGame();
}
@Override
public void render()
{
Gdx.gl.glClearColor(0.9f, 0.9f, 0.9f, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
// Draw background
for (int i = 0; i < 30; i++)
batch.draw(backgroundTexture, i * 2900, 0, 2900, 800);
// Draw rocks
for (Rectangle r : rockPositions)
batch.draw(rockTexture, r.x, r.y, r.width, r.height);
// Draw man
batch.draw(walkAnimation.getKeyFrame(time, true), manPosition.x, manPosition.y, manPosition.width, manPosition.height);
font.draw(batch, (int) (manPosition.x / 70) + "m", camera.position.x - 10, 30);
batch.end();
// Move man
time += Gdx.graphics.getDeltaTime();
manPosition.x += manVelocity.x * Gdx.graphics.getDeltaTime();
manPosition.y += manVelocity.y * Gdx.graphics.getDeltaTime();
manVelocity.y -= 1000 * Gdx.graphics.getDeltaTime();
if (Gdx.input.isTouched() && manPosition.y == 0)
{
manVelocity.y = 500;
}
if (manPosition.y < 0)
{
manPosition.y = 0;
manVelocity.y = 0;
}
// Move camera
camera.translate((manVelocity.x - camera.viewportWidth / 80) * Gdx.graphics.getDeltaTime(), 0);
// Detect collision
for (Rectangle r : rockPositions)
{
if (r.overlaps(manPosition) && r.getCenter(new Vector2()).dst(manPosition.getCenter(new Vector2())) < 120)
{
collisionSound.play();
resetGame();
break;
}
}
}
private void resetGame()
{
configureCamera();
manPosition = new Rectangle(0, 0, 200, 200);
manVelocity = new Vector2(500, 0);
}
private void configureCamera()
{
if (Gdx.graphics.getHeight() < Gdx.graphics.getWidth())
camera.setToOrtho(false, 800, 800 * Gdx.graphics.getHeight() / Gdx.graphics.getWidth());
else
camera.setToOrtho(false, 800 * Gdx.graphics.getWidth() / Gdx.graphics.getHeight(), 800);
}
@Override
public void dispose()
{
batch.dispose();
}
@Override
public void resize(int width, int height)
{
resetGame();
}
@Override
public void pause()
{
}
@Override
public void resume()
{
}
import com.badlogic.gdx.*;
import com.badlogic.gdx.audio.*;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.*;
import com.badlogic.gdx.math.*;
import java.util.*;
public class MyGdxGame implements ApplicationListener
{
OrthographicCamera camera;
Animation walkAnimation;
TextureRegion backgroundTexture;
TextureRegion rockTexture;
Sound collisionSound;
BitmapFont font;
SpriteBatch batch;
float time;
Rectangle manPosition;
Vector2 manVelocity;
List<Rectangle> rockPositions;
@Override
public void create()
{
// Load background
Texture texture = new Texture(Gdx.files.internal("skyBackground.jpg"));
backgroundTexture = new TextureRegion(texture, 0, 0, 2048, 563);
// Load and position rocks
Texture texture2 = new Texture(Gdx.files.internal("rock.png"));
rockTexture = new TextureRegion(texture2, 25, 0, 250, 250);
rockPositions = new ArrayList<Rectangle>();
int x = 1800;
for (int i = 0; i < 60; i++)
{
rockPositions.add(new Rectangle(x, 0, 100, 100));
x += 600 + new Random().nextInt(600);
}
// Create run animation
Texture walkSheet = new Texture(Gdx.files.internal("runAnimation.png"));
int FRAME_COLS = 6;
int FRAME_ROWS = 5;
TextureRegion[][] tmp = TextureRegion.split(walkSheet, walkSheet.getWidth() / FRAME_COLS, walkSheet.getHeight() / FRAME_ROWS);
TextureRegion[] walkFrames = new TextureRegion[FRAME_COLS * FRAME_ROWS];
int index = 0;
for (int i = 0; i < FRAME_ROWS; i++)
{
for (int j = 0; j < FRAME_COLS; j++)
{
walkFrames[index++] = tmp[i][j];
}
}
walkAnimation = new Animation(0.025f, walkFrames);
font = new BitmapFont();
collisionSound = Gdx.audio.newSound(Gdx.files.internal("collision.wav"));
batch = new SpriteBatch();
camera = new OrthographicCamera();
resetGame();
}
@Override
public void render()
{
Gdx.gl.glClearColor(0.9f, 0.9f, 0.9f, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
camera.update();
batch.setProjectionMatrix(camera.combined);
batch.begin();
// Draw background
for (int i = 0; i < 30; i++)
batch.draw(backgroundTexture, i * 2900, 0, 2900, 800);
// Draw rocks
for (Rectangle r : rockPositions)
batch.draw(rockTexture, r.x, r.y, r.width, r.height);
// Draw man
batch.draw(walkAnimation.getKeyFrame(time, true), manPosition.x, manPosition.y, manPosition.width, manPosition.height);
font.draw(batch, (int) (manPosition.x / 70) + "m", camera.position.x - 10, 30);
batch.end();
// Move man
time += Gdx.graphics.getDeltaTime();
manPosition.x += manVelocity.x * Gdx.graphics.getDeltaTime();
manPosition.y += manVelocity.y * Gdx.graphics.getDeltaTime();
manVelocity.y -= 1000 * Gdx.graphics.getDeltaTime();
if (Gdx.input.isTouched() && manPosition.y == 0)
{
manVelocity.y = 500;
}
if (manPosition.y < 0)
{
manPosition.y = 0;
manVelocity.y = 0;
}
// Move camera
camera.translate((manVelocity.x - camera.viewportWidth / 80) * Gdx.graphics.getDeltaTime(), 0);
// Detect collision
for (Rectangle r : rockPositions)
{
if (r.overlaps(manPosition) && r.getCenter(new Vector2()).dst(manPosition.getCenter(new Vector2())) < 120)
{
collisionSound.play();
resetGame();
break;
}
}
}
private void resetGame()
{
configureCamera();
manPosition = new Rectangle(0, 0, 200, 200);
manVelocity = new Vector2(500, 0);
}
private void configureCamera()
{
if (Gdx.graphics.getHeight() < Gdx.graphics.getWidth())
camera.setToOrtho(false, 800, 800 * Gdx.graphics.getHeight() / Gdx.graphics.getWidth());
else
camera.setToOrtho(false, 800 * Gdx.graphics.getWidth() / Gdx.graphics.getHeight(), 800);
}
@Override
public void dispose()
{
batch.dispose();
}
@Override
public void resize(int width, int height)
{
resetGame();
}
@Override
public void pause()
{
}
@Override
public void resume()
{
}
}
Past this code in your android studion ,congratulations you just created your first android game.you can equally download this game here https://drive.google.com/folderview?id=0B186Er3E-B7Kc3Z4a2h4a1ppY1k
We Cherish Your Comments Most, Kindly Drop your comments below. Don't forget to click "Notify Me" to know if we have responded to your comments, Thank You.
EmoticonEmoticon