Archive

Archive for the ‘Android’ Category

How To Develop Graphics(String and Shape) in Android

in the latest article, we discuss about J2ME Game development version 1.0, in this article, we discuss how to develop graphics in android. the differences in my opinion is:

1. different super class. in J2ME, we usually using canvas, in android, we can use View class

2. different method. in Android, we can use onDraw class

ok, lets begin

– Make 2 class in your android projects. Main.java and Game.java

– paste this script into Game.java


package game.game;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;

public class Game extends View{
 private Context ctx;
 private float x,y;
 private float posX ;
 private float posY = getHeight()/2;
 public Game(Context context) {
 super(context);
 // TODO Auto-generated constructor stub
 this.ctx = context;
 }
 @Override
 protected void onDraw(Canvas canvas) {
 // TODO Auto-generated method stub
 try
 {
 posX = getWidth()/2;
 posY = getHeight()/2;
 Paint paint = new Paint();
 paint.setColor(Color.rgb(255, 255, 255));
 paint.setTextSize(20);
 canvas.drawCircle(getWidth()/2, getHeight()/2, 50, paint);
 canvas.drawText("OCTAV", getWidth()/2+50,getHeight()/2+50, paint);
 canvas.drawText("X : "+x, 30, 30, paint);
 canvas.drawText("\nY : "+y, 100, 100, paint);
 }

<!--more-->
 catch (Exception e) {
 // TODO: handle exception
 Toast.makeText(ctx, "Error : "+e.getMessage(), Toast.LENGTH_LONG).show();
 }
 }
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
 // TODO Auto-generated method stub
 if(keyCode==KeyEvent.KEYCODE_DPAD_DOWN)
 {
 Toast.makeText(ctx, "Ditarik kebawah", Toast.LENGTH_LONG).show();
 }
 return true;
 }
 @Override
 public boolean onTouchEvent(MotionEvent event) {
 // TODO Auto-generated method stub
 x = event.getX();
 y = event.getY();
 this.invalidate();
 return true;
 }
}

– paste this script into Main.java


package game.game;

import android.app.Activity;
import android.os.Bundle;

public class Main extends Activity {
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 try
 {
 setContentView(new Game(this));
 }
 catch (Exception e) {
 System.out.println("Error : "+e.getMessage());
 }
 }
}

Advertisements
Categories: Android

Nusantara Kuliner (Nusantaraku)

September 20, 2012 Leave a comment

Download This Android Application only at Play google :
https://play.google.com/store/apps/details?id=seamolec.nusantara&feature=search_result

NUSANTARAKU is an application which provide information to tourist and people in Indonesia and a

nother country who want to
know about Indonesian Foods or Indonesian Culiner with detail information..
For Further Information , Please Contacts : email@ibnuimam.com
Application Features :
1. Explore Nusantaraku
– Food and Drink from 33 province of Indonesia
– show Restaurant Information in the list
– Top Rate Food from User
– Share Information about Culiner to Another people which connected by Facebook, Twitter, Mail, and other social media
– Show Video Information per Foods
2. Restaurant Registration
– Foods
– Restaurant Name
– Best Food
3. Show Location to user how to go to near restaurant.

Categories: Android

Pemprograman Mobile Android

Android? ? pada tahun 2007 hampir tidak pernah kita mendengar kalimat ini untuk suatu device mobile. Pada masa itu, sedang trend teknologi J2ME baik itu games , aplikasi office dll. 2010 – 2012 mungkin di Indonesia sedang booming android device,, mengapa booming? cerdas sekali trik google membeli android.inc ini, menyulap perusahaan yang mulanya tidak terkenal, sekarang produk OS nya digunakan banyak vendor mobile bahkan di tanah air…

Android merupakan sistem operasi khusus mobile yang dikembangkan dari Linux. dikarenakan linux memiliki GPL (General Public License), maka android pun bebas dikembangkan oleh siapapun, termasuk aplikasinya..

Kita tidak perlu mengeluarkan uang untuk mendownload android development.

Tanpa basa basi, langsung saja jika teman teman tertarik untuk membangun aplikasi berbasis Android, maka download E-book buatan saya di link berikut :

http://ilmukomputer.org/2012/04/18/pemrograman-mobile-android/

Semoga bermanfaat

 

Categories: Android