ANDROID

359 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
359
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ANDROID

  1. 1. Notice the following information, the bold and red texts are where you Should focus on.
  2. 2. Android Tips
  3. 3. <ul><li>< uses-permission android:name = &quot;android.permission.INTERNET&quot; /> </li></ul><ul><li></ manifest > </li></ul>
  4. 4. <ul><li>Intent i = new Intent(setup. this , CoList. class ); </li></ul><ul><li>i.putExtra(CoList. KEY_PORT , port); </li></ul><ul><li>i.putExtra(CoList. KEY_URL , url); </li></ul><ul><li>startActivityForResult(i, ACTIVITY_CREATE ); </li></ul>
  5. 5. <ul><li>final Handler mHandler = new Handler() { </li></ul><ul><ul><li>@Override </li></ul></ul><ul><ul><li>public void handleMessage(Message msg) { </li></ul></ul><ul><ul><ul><li>Socket s = (Socket) msg. obj ; </li></ul></ul></ul><ul><ul><ul><li>socketList .add(s); </li></ul></ul></ul><ul><ul><ul><li>String str = s.getInetAddress().getHostAddress(); </li></ul></ul></ul><ul><ul><ul><li>ipAdapter .add(str); </li></ul></ul></ul><ul><ul><ul><li>setListAdapter( ipAdapter ); </li></ul></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>}; </li></ul>
  6. 8. <ul><li>public boolean onKeyDown( int keyCode, KeyEvent event) { </li></ul><ul><li>pd = ProgressDialog.show( this , &quot;Working..&quot; , &quot;Calculating Pi&quot; , true , </li></ul><ul><li>false ); </li></ul><ul><li>Thread thread = new Thread( this ); </li></ul><ul><li>thread.start(); </li></ul><ul><li>return super .onKeyDown(keyCode, event); </li></ul><ul><li>} </li></ul>

×