Wednesday, January 2, 2008

Android User Interface Designer


Just want to design User Interface easily, I have created Android User Interface Designer. In the first version, I have included Label, EditText, and Button Object. Later, Other object will be included. Other Object will be included in the next version.

Each Object packed with minimal property, and layout with RelativeLayout. Just to make it easy for beginner, and to simplify coding. The next version will include more property.

Layout used in this version is RelativeLayout with its hight and width specified as "fill_parent". That means, this layout will covers all screen.

Each Object packed with attribute: height, width in ps, and text. MultiLine specified for EditText only.

If you are interested on trying this program, please see on http://files.pemikiran.com whenever it is ready to download. And I plan to publish the tool at Sourceforge.Net.

10 comments:

Karthik said...

hey i am new to anroid.plz tel me hw to create button..

Bhayangkara said...

Hi karthik,

It is as simple as you create an XML file, and fill it with declaration/definition in it to make a button. For a button, the declaration is &ltButton ...&gt.
For your information, new version of ADT (Android Plugin run inside Eclipse) come with tools like this.

Karthik said...

thanks dude...bt i want to create button in java code...

Bhayangkara said...

Well, if you want to create button in java code, than first thing to remember is you have to know the layout you use in your code. below is piece of code of simple implementation, should be ok:

...in onCreate(Bundle savedInstanceState) ...

Button b = new Button (this);
b.setText("Press Me!");
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
setContentView(b, lp);

...
That routine should show a button with "Press Me" Text on it.

Karthik said...

Thanks for your responce..hey i hav writeen bt it shows a error..my code is like that...

package pack.button;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import pack.button.R;

public class SimpleButton extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b1=(Button)findviewById(R.id.button01);
}


R.id cannot be resoived

Karthik said...

ya thank u very much yar....that code is working...thanks alot...

Bhayangkara said...

Karthik,

you 're welcome, great!, you have success compile and run it.
About your code, did you forget about the xml file ? R is automatically generate after compiling android project, if in your project there is layout file (usually main.xml).

Ok, Have A Nice Try!

Karthik said...

thanks yar...hey i am creating Tic Tack Toe game.....give some idea...means logic..plz

Bhayangkara said...

Karthik,

Great!
Just grab in the internet, one of them visit at http://en.wikipedia.org/wiki/Tic-tac-toe.

Have A Nice try!

Karthik said...

ya thats fine article..thanks yar..hey i hav decided to create UI first.hw to creat that board...plz tell me..if u know code plz send i will refer..an tell me which classes i hv to use..