Thursday, May 15, 2014

Android Application හදමු - Introduction Part II

If you missed the very first tutorial please visit this link - Android Tutorial Part I

දැන් කට්ටියම Android Studio Install කරගෙන ඇති කියලා මං හිතනවා.ඔයාලගෙ පහසුවට මම steps by steps Images විදියට කියලා දෙන්නම්.

1. ඉස්‍සලම New Project ගිහින් ඔයා හදන App එකේ නම දෙන්න

2.ඊට පස්සෙ App එකේ icon එකේ size එක හදාගන්න

3. දැන් හදන App එක Blank Activity කියලා දෙන්න

4.Main Activity එකට කැමති නමක්. දීලා next යන්න

5.දැන් මේ වගෙ Window එකක් එයි.

6.ඒකෙ අපි දැන් configure කරපු settings වලට අදාල view එක ගන්න right side එකේ පේන path එක expand කරන්න. එතකොට designing view එකට අදාල xml file එක open වෙයි.

දැන් මේ window එකේ hello world කියන text එකේ color එක වෙනස් කරමු අපි
<TextView තැන android:textColor="@android:color/holo_blue_dark" කියලා type කරන්න
ඔයාලගෙ පහසුවට CTRL+SPACE use කරලා suggestions ගන්න

දැන් හොදට බලන්න text එක blue පාටින් පෙනෙවි.

Noe lets move to design view click on the bottom tab Design and go to design view

After that we will try to add a button for our app,

දැන් අපි button එක add කරමු, Phone view එ‍කට right side එකේ තියන palette එකෙන් button එක Drag and Drop කරන්න. දැන් නැවතත් Text View එකට යන්න (Text view is on the Bottom right of the palette)

දැන් දකින්න පුලුවන් වේවි
<Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Button"
        android:id="@+id/button"
        android:layout_marginTop="87dp"
        android:layout_below="@+id/textView"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />
කියලා.....

ඒකෙත් කැමති විදියකට text and color change කරන්න පුලුවන්
 android:text="Submit"

ඔය විදියට Try කරලා interface එක පුරුදු වෙන්න .....


අපි ඊලග tutorial එකෙන් බලමු App එක run කරන්නයි Java File එක edit කරලා button එක press කරාම message එකක් එන විදියයි. මං හිතනව මුල ඉදන්ම android පටන් ගන්න අයට මේ tutorial එක ගොඩක් වැදගත් වෙයි කියලා.

ප්‍රශ්න තියනවනම් comment කරන්න ඊලග tuto එකෙන් හමුවෙමු .

No comments:

Post a Comment