1. 程式人生 > >Android手機通過wifi進行數據傳輸(四)

Android手機通過wifi進行數據傳輸(四)

int apk nal com urn contacts views parent world

源文件5 main.xml

<?xml version="1.0" encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TextView android:layout_width
="fill_parent" android:layout_height="wrap_content" android:text="@string/hello"/> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/turn_on_send"
android:onClick="onClick"/> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/turn_on_receiver" android:onClick="onClick"/> <Button android:id
="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/turn_on_send" android:onClick="onClick"/> <Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/turn_on_receiver" android:onClick="onClick"/> <TextView android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

源文件6 strings.xml

<?xml version="1.0" encoding="utf-8"?> <resources> <stringname="hello">Hello World, QuickTransferActivity!</string> <stringname="app_name">QuickTransfer</string> <stringname="turn_on_send">開啟發送</string> <stringname="turn_off_send">關閉發送</string> <stringname="turn_on_receiver">開啟接受</string> <stringname="turn_off_receiver">關閉接受</string> </resources>

AndroidManifest.xml文件 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="edu.cdut.robin" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BROADCAST_STICKY" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.GET_TASKS" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.READ_LOGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.RESTART_PACKAGES" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.INSTALL_PACKAGES" /> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".QuickTransferActivity" 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> </manifest> 結束!

再分享一下我老師大神的人工智能教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智能的隊伍中來!http://www.captainbed.net

Android手機通過wifi進行數據傳輸(四)