初次提交
This commit is contained in:
7
第2章 游戏开发基础知识/Sample2_4_From/.classpath
Normal file
7
第2章 游戏开发基础知识/Sample2_4_From/.classpath
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
33
第2章 游戏开发基础知识/Sample2_4_From/.project
Normal file
33
第2章 游戏开发基础知识/Sample2_4_From/.project
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Sample2_4_From</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
18
第2章 游戏开发基础知识/Sample2_4_From/AndroidManifest.xml
Normal file
18
第2章 游戏开发基础知识/Sample2_4_From/AndroidManifest.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.bn.pp4f"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
||||
<activity android:name=".ContentConsumerActivity"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
<uses-sdk android:minSdkVersion="7" />
|
||||
|
||||
</manifest>
|
||||
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/Sample2_4_From.apk
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/Sample2_4_From.apk
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/classes.dex
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/classes.dex
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$attr.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$attr.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$color.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$color.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$drawable.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$drawable.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$id.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$id.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$layout.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$layout.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$string.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R$string.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R.class
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/com/bn/pp4f/R.class
Normal file
Binary file not shown.
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/resources.ap_
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/bin/resources.ap_
Normal file
Binary file not shown.
13
第2章 游戏开发基础知识/Sample2_4_From/default.properties
Normal file
13
第2章 游戏开发基础知识/Sample2_4_From/default.properties
Normal file
@@ -0,0 +1,13 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Indicates whether an apk should be generated for each density.
|
||||
split.density=false
|
||||
# Project target.
|
||||
target=android-7
|
||||
36
第2章 游戏开发基础知识/Sample2_4_From/gen/com/bn/pp4f/R.java
Normal file
36
第2章 游戏开发基础知识/Sample2_4_From/gen/com/bn/pp4f/R.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*
|
||||
* This class was automatically generated by the
|
||||
* aapt tool from the resource data it found. It
|
||||
* should not be modified by hand.
|
||||
*/
|
||||
|
||||
package com.bn.pp4f;
|
||||
|
||||
public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class color {
|
||||
public static final int black=0x7f040004;
|
||||
public static final int blue=0x7f040002;
|
||||
public static final int gray=0x7f040005;
|
||||
public static final int green=0x7f040001;
|
||||
public static final int red=0x7f040000;
|
||||
public static final int white=0x7f040003;
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int icon=0x7f020000;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int Button01=0x7f060000;
|
||||
public static final int EditText02=0x7f060002;
|
||||
public static final int ScrollView01=0x7f060001;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int main=0x7f030000;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int app_name=0x7f050001;
|
||||
public static final int hello=0x7f050000;
|
||||
}
|
||||
}
|
||||
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-hdpi/icon.png
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-hdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-ldpi/icon.png
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-ldpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-mdpi/icon.png
Normal file
BIN
第2章 游戏开发基础知识/Sample2_4_From/res/drawable-mdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
29
第2章 游戏开发基础知识/Sample2_4_From/res/layout/main.xml
Normal file
29
第2章 游戏开发基础知识/Sample2_4_From/res/layout/main.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<Button
|
||||
android:text="获取"
|
||||
android:id="@+id/Button01"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
<ScrollView
|
||||
android:id="@+id/ScrollView01"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<EditText
|
||||
android:id="@+id/EditText02"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</EditText>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
9
第2章 游戏开发基础知识/Sample2_4_From/res/values/colors.xml
Normal file
9
第2章 游戏开发基础知识/Sample2_4_From/res/values/colors.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="red">#fd8d8d</color>
|
||||
<color name="green">#9cfda3</color>
|
||||
<color name="blue">#8d9dfd</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="black">#000000</color>
|
||||
<color name="gray">#050505</color>
|
||||
</resources>
|
||||
5
第2章 游戏开发基础知识/Sample2_4_From/res/values/strings.xml
Normal file
5
第2章 游戏开发基础知识/Sample2_4_From/res/values/strings.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="hello">Hello World, ContentConsumerActivity!</string>
|
||||
<string name="app_name">Sample2_4_From</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.bn.pp4f;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
public class ContentConsumerActivity extends Activity {
|
||||
ContentResolver cr;
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main);
|
||||
cr=this.getContentResolver();
|
||||
//初始化查询按钮
|
||||
Button b=(Button)this.findViewById(R.id.Button01);
|
||||
b.setOnClickListener(
|
||||
new OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String stuname="Android";
|
||||
Cursor cur=cr.query(
|
||||
Uri.parse("content://com.bn.pp4.provider.student/stu"),
|
||||
new String[]{"sno","stuname","sage","sclass"},
|
||||
"stuname=?",
|
||||
new String[]{stuname},
|
||||
"sage ASC"
|
||||
);
|
||||
while(cur.moveToNext()){
|
||||
String sno=cur.getString(0);
|
||||
String sname=cur.getString(1);
|
||||
int sage=cur.getInt(2);
|
||||
String sclass=cur.getString(3);
|
||||
appendMessage(sno+"\t"+sname+"\t\t"+sage+"\t"+sclass);
|
||||
}
|
||||
cur.close();
|
||||
}});}
|
||||
public void appendMessage(String msg){ //向文本区中添加文本
|
||||
EditText et=(EditText)this.findViewById(R.id.EditText02);
|
||||
et.append(msg+"\n");
|
||||
}}
|
||||
Reference in New Issue
Block a user