igdshare 110220: android 遊戲開發簡介
DESCRIPTION
This slide covers some basics about Android UI, graphics and Licensing Verification Library. related source code: https://gist.github.com/840794 https://gist.github.com/840797 http://blog.igdshare.org http://www.youtube.com/user/igdshareTRANSCRIPT
Android 遊戲開發簡介
報告人 hsufong
大綱
1.android 手機遊戲簡介 2.UI 、繪圖與控制 3. 遊戲資料儲存 4. License Verification Library
android 手機遊戲簡介
android 手機遊戲簡介
使用語言 :Java 、 C/C++ (NDK) 、 XML 開發工具 :eclipse,android SDK, AVD
UI 、繪圖與控制
UI 、繪圖與控制 : Layout<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp"> <ImageView android:id="@+id/image1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10dp"/> <TextView android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<Button android:id="@+id/button1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Option"android:textColor="#E2E3F4"></Button>
</LinearLayout>
UI 、繪圖與控制 : 事件
ImageView image = (ImageView) findViewById(R.id.image1);image.setImageResource(R.drawable.member_01);
TextView text = (TextView) findViewById(R.id.text1);text.setText("test");
Button NewGameButton = (Button)findViewById(R.id.button1); NewGameButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent NewGameIntent = new Intent(start.this,NewGame.clas
s); startActivity(NewGameIntent); }});
UI 、繪圖與控制 :SurfaceView public boolean onTouchEvent(MotionEvent e
vent) public void onDraw(Canvas canvas)
See the demo program
遊戲資料儲存
在 Java 程式中撰寫程式,很多資料都是以物件的方式存在,資料需要儲存,以供下次執行程式時使用時可使用 ObjectInputStream 、ObjectOutputStream 來進行這項工作
要被儲存的物件必須實作 Serializable介面 See the demo program
License Verification Library
http://developer.android.com/guide/publishing/licensing.html
http://www.e68club.com/2010/09/license-verification-library-lvl.html
My game
My game
Q&A
個人專長 C/C++ 、 Java 、 video server 、 embedded 、
google web toolkit 、 google app engine 、 Linux Device Driver 、 MFC 、 Win api 、 Sqlit
e 、 android api 。My demo web :http://www.findcase.net/