我有两种方法可以尝试在Android设备上启动WiFi热点,以便其他人可以连接并玩游戏。问题是这两种方法都有问题而且不起作用。
第一种方法:
public void ConnectWiFi()
{
try
{
using (AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"))
{
using (var wifiManager = activity.Call("getSystemService", "wifi"))
{
AndroidJavaObject wifiConfiguration = new AndroidJavaClass("android.net.wifi.WifiConfiguration");
wifiConfiguration.Set("SSID", meSSID); // string
wifiConfiguration.Set("preSharedKey", mePassword); // string
wifiManager.Call("setWifiApEnabled", wifiConfiguration, enabled);
}
}
}
catch (System.Exception E)
{
T.text += "\nE - " + E.Message;
T.text += "\n\t" + E.StackTrace+"\n";
}
}
它崩溃了游戏,我无法调试它。 这是它的日志:
W/ActivityManager( 550): mDVFSHelper.acquire()
W/ActivityThread(17070): Application com.thenightafterdoomsday.nomercy can be debugged on port 8100...
I/Unity (17070): splash_mode = 0 (integer)
I/Unity(17070): useObb = False(bool)
I/Unity(17070): onResume
I/Unity(17070): windowFocusChanged: true
W/ActivityManager( 550): mDVFSHelper.release()
E/Unity(17070): GLSL: unsupported array parameter 'unity_WorldToShadow'
E/Unity(17070): Stacktrace is not supported on this platform.
E/Unity (17070): (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
E/Unity (17070):
E/Unity (17070): GLSL: unsupported array parameter 'unity_WorldToShadow'
E/Unity (17070): Stacktrace is not supported on this platform.
E/Unity (17070): (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
E/Unity (17070):
E/Unity (17070): -------- GLSL link error: ERROR:LEX/PARSE-2 (line 38) Undefined identifier
E/Unity (17070):
E/Unity (17070):
E/Unity (17070): Stacktrace is not supported on this platform.
E/Unity (17070): (Filename: ./Runtime/GfxDevice/opengles/ApiGLES.cpp Line: 685)
E/Unity (17070):
E/Unity (17070): GLSL: unsupported array parameter 'unity_LightColor'
E/Unity (17070): Stacktrace is not supported on this platform.
E/Unity (17070): (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
E/Unity (17070):
E/Unity (17070): GLSL: unsupported array parameter 'unity_LightPosition'
E/Unity (17070): Stacktrace is not supported on this platform.
E/Unity (17070): (Filename: ./Runtime/GfxDevice/opengles/GpuProgramParamsGLES.cpp Line: 246)
E/Unity (17070):
I/DEBUG (15581): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG (15581): Build fingerprint: 'samsung/baffinxx/baffin:4.2.2/JDQ39/I9082XXUBNC1:user/release-keys'
I/DEBUG (15581): Revision: '5'
I/DEBUG (15581): pid: 17070, tid: 17086, name: UnityMain >>> com.thenightafterdoomsday.nomercy
I/DEBUG (15581):
I/DEBUG (15581): stack:
I/DEBUG (15581): 56b4d1c8 41c0f648 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (15581): 56b4d1cc 41c0f648 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG (15581): 56b4d1d0 4103b3b8
I/DEBUG (15581): 56b4d1d4 4103b460
I/DEBUG (15581): 56b4d1d8 4103b3b8
I/DEBUG (15581): 56b4d1dc 40991ebf /system/lib/libdvm.so (dvmReleaseTrackedAlloc+30)
I/DEBUG (15581): 56b4d1e0 56b4d20c
I/DEBUG (15581): 56b4d1e4 4ca4a564 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG (15581): 56b4d1e8 49334a40
I/DEBUG (15581): 56b4d1ec 00000000
I/DEBUG (15581): 56b4d1f0 4ca4a564 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG (15581): 56b4d1f4 4098723f /system/lib/libdvm.so (dvmDecodeIndirectRef(Thread*, _jobject*)+34)
I/DEBUG (15581): 56b4d1f8 00000000
I/DEBUG (15581): 56b4d1fc 4ca4a564 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG (15581): 56b4d200 df0027ad
I/DEBUG (15581): 56b4d204 00000000
I/DEBUG (15581): #00 56b4d208 49334a40
I/DEBUG (15581): 56b4d20c 4103b3b8
I/DEBUG (15581): 56b4d210 4ca4a564 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG (15581): 56b4d214 409885a7 /system/lib/libdvm.so
I/DEBUG (15581): 56b4d218 00000000
I/DEBUG (15581): 56b4d21c 49334a40
I/DEBUG (15581): 56b4d220 56b4d22c
I/DEBUG (15581): 56b4d224 55fe752c /mnt/asec/com.thenightafterdoomsday.nomercy-1/lib/libunity.so (AndroidJNI_CUSTOM_SetStringField(void*, void*, ICallString)+284)
I/DEBUG (15581): #01 56b4d228 49588ee0
I/DEBUG (15581): 56b4d22c 50c7396c
I/DEBUG (15581): 56b4d230 20c0000d
I/DEBUG (15581): 56b4d234 41135c00
I/DEBUG (15581): 56b4d238 49334a40
I/DEBUG (15581): 56b4d23c 4984fd20
I/DEBUG (15581): 56b4d240 56948d9c
I/DEBUG (15581): 56b4d244 49591ed8
I/DEBUG (15581): 56b4d248 55527c20 /mnt/asec/com.thenightafterdoomsday.nomercy-1/lib/libmono.so
I/DEBUG (15581): 56b4d24c 56b4da70
I/DEBUG (15581): 56b4d250 00000001
I/DEBUG (15581): 56b4d254 ffffffff
I/DEBUG (15581): 56b4d258 50c29170
I/DEBUG (15581): 56b4d25c 50c95048
I/DEBUG (15581): #02 56b4d260 00000000
I/DEBUG (15581):
I/DEBUG (15581): memory near r0:
I/DEBUG (15581): 41c0f628 00000009 00000000 00700077 00530073
I/DEBUG (15581): 41c0f638 00610074 00750074 00000073 00000023
I/DEBUG (15581): 41c0f648 412400e0 00000000 41c0f668 3920c217
I/DEBUG (15581): 41c0f658 00000000 00000009 00000000 0000002b
I/DEBUG (15581): 41c0f668 41240950 00000000 00000009 00000000
I/DEBUG (15581): 41c0f678 0065004d 006f0048 00530074 006f0070
I/DEBUG (15581): 41c0f688 00000074 00000043 41243308 00000000
I/DEBUG (15581): 41c0f698 00000000 41a83978 00000000 00000000
I/DEBUG (15581): 41c0f6a8 00000000 00000000 00000000 4123f2a8
I/DEBUG (15581): 41c0f6b8 41c0f6e8 41c0f6d0 00000000 00000000
I/DEBUG (15581): 41c0f6c8 00000000 0000001b 4123fc98 00000000
I/DEBUG (15581): 41c0f6d8 00000001 00000000 4123f698 00000023
I/DEBUG (15581): 41c0f6e8 412400e0 00000000 41c0f708 6b68cba2
I/DEBUG (15581): 41c0f6f8 00000000 00000007 00000000 0000002b
I/DEBUG (15581): 41c0f708 41240950 00000000 00000007 00000000
I/DEBUG (15581): 41c0f718 006f0064 00720046 006d0061 00000065
I/DEBUG (15581):
I/DEBUG (15581): memory near r5:
I/DEBUG (15581): 4ca4a544 4f36ba3e 00000001 00000014 41c0b228
I/DEBUG (15581): 4ca4a554 4f32e24d 4f36ba3e 00000001 00000018
I/DEBUG (15581): 4ca4a564 41c0b228 4f385c1b 4f36ba3e 00000001
I/DEBUG (15581): 4ca4a574 0000001c 41c0b228 4f3b5ea8 4f36d0d7
I/DEBUG (15581): 4ca4a584 00000001 00000020 41c0b228 4f3b5edc
I/DEBUG (15581): 4ca4a594 4f36d0d7 00000001 00000024 41c0b228
I/DEBUG (15581): 4ca4a5a4 4f3b5f0c 4f36d0d7 00000001 00000028
I/DEBUG (15581): 4ca4a5b4 41c0b228 4f3b5f3e 4f36d0d7 00000001
I/DEBUG (15581): 4ca4a5c4 0000002c 41c0b228 4f3b5f74 4f36d0d7
I/DEBUG (15581): 4ca4a5d4 00000001 00000030 41c0b228 4f3b9d65
I/DEBUG (15581): 4ca4a5e4 4f34a1a3 00000001 00000034 41c0b228
I/DEBUG (15581): 4ca4a5f4 4f43ba11 4f3b13e3 00000001 00000038
I/DEBUG (15581): 4ca4a604 41c0b228 4f43b70d 4f36ba3e 00000001
I/DEBUG (15581): 4ca4a614 0000003c 41c0b228 4f3bd46a 4f34a1a3
I/DEBUG (15581): 4ca4a624 00000001 00000040 41c0b228 4f43b699
I/DEBUG (15581): 4ca4a634 4f36ba3e 00000001 00000044 41c0b228
I/DEBUG (15581):
I/DEBUG (15581): memory near r6:
I/DEBUG (15581): 49334a20 006e0061 0000001b 41b8d070 696e752f
I/DEBUG (15581): 49334a30 64337974 616c702f 2f726579 00000023
I/DEBUG (15581): 49334a40 409e4328 00000000 0000000b 4103b3b8
I/DEBUG (15581): 49334a50 00000000 4c4e8908 4c4dc658 00000023
I/DEBUG (15581): 49334a60 41b8d070 40150c74 0000003b 00000011
I/DEBUG (15581): 49334a70 00000000 00000000 00000020 00000023
I/DEBUG (15581): 49334a80 000f0284 00200011 0b0a0909 0b09090d
I/DEBUG (15581): 49334a90 0a080a0c 00000d0b 00000020 0000001b
I/DEBUG (15581): 49334aa0 00090184 0904000a 0a080909 000c1511
I/DEBUG (15581): 49334ab0 00000018 0000004b 00110000 40150c9c
I/DEBUG (15581): 49334ac0 00720065 00630069 002f0061 00610042
I/DEBUG (15581): 49334ad0 00690068 005f0061 00610042 0064006e
I/DEBUG (15581): 49334ae0 00720065 00730061 00000000 0001010a
I/DEBUG (15581): 49334af0 006ddd00 00000000 00000048 00000013
I/DEBUG (15581): 49334b00 00000001 00000000 4932cbe8 0000001b
I/DEBUG (15581): 49334b10 00000002 00000000 4932cbe8 00000000
I/DEBUG (15581):
I/DEBUG (15581): memory near r7:
I/DEBUG (15581): 20bfffec ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20bffffc ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0000c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0001c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0002c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0003c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0004c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0005c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0006c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0007c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0008c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c0009c ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c000ac ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c000bc ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c000cc ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 20c000dc ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581):
I/DEBUG (15581): memory near r8:
I/DEBUG (15581): 4ca4a544 4f36ba3e 00000001 00000014 41c0b228
I/DEBUG (15581): 4ca4a554 4f32e24d 4f36ba3e 00000001 00000018
I/DEBUG (15581): 4ca4a564 41c0b228 4f385c1b 4f36ba3e 00000001
I/DEBUG (15581): 4ca4a574 0000001c 41c0b228 4f3b5ea8 4f36d0d7
I/DEBUG (15581): 4ca4a584 00000001 00000020 41c0b228 4f3b5edc
I/DEBUG (15581): 4ca4a594 4f36d0d7 00000001 00000024 41c0b228
I/DEBUG (15581): 4ca4a5a4 4f3b5f0c 4f36d0d7 00000001 00000028
I/DEBUG (15581): 4ca4a5b4 41c0b228 4f3b5f3e 4f36d0d7 00000001
I/DEBUG (15581): 4ca4a5c4 0000002c 41c0b228 4f3b5f74 4f36d0d7
I/DEBUG (15581): 4ca4a5d4 00000001 00000030 41c0b228 4f3b9d65
I/DEBUG (15581): 4ca4a5e4 4f34a1a3 00000001 00000034 41c0b228
I/DEBUG (15581): 4ca4a5f4 4f43ba11 4f3b13e3 00000001 00000038
I/DEBUG (15581): 4ca4a604 41c0b228 4f43b70d 4f36ba3e 00000001
I/DEBUG (15581): 4ca4a614 0000003c 41c0b228 4f3bd46a 4f34a1a3
I/DEBUG (15581): 4ca4a624 00000001 00000040 41c0b228 4f43b699
I/DEBUG (15581): 4ca4a634 4f36ba3e 00000001 00000044 41c0b228
I/DEBUG (15581):
I/DEBUG (15581): memory near r9:
I/DEBUG (15581): 568ce8a0 00000000 00000000 00000000 00000000
I/DEBUG (15581): 568ce8b0 00000000 00000000 00004000 00000000
I/DEBUG (15581): 568ce8c0 00000101 00000001 00000000 00000000
I/DEBUG (15581): 568ce8d0 00000000 565b5fe5 00000008 00000000
I/DEBUG (15581): 568ce8e0 00000000 565de63a 00000000 565de649
I/DEBUG (15581): 568ce8f0 00000000 565de661 00000001 565de672
I/DEBUG (15581): 568ce900 0000000d 565de683 0000000f 565de69b
I/DEBUG (15581): 568ce910 0000000f 565de6b4 0000000f 565de6cf
I/DEBUG (15581): 568ce920 0000000b 565de6e2 0000000f 565de6f3
I/DEBUG (15581): 568ce930 00000001 565de70a 00000000 565de71b
I/DEBUG (15581): 568ce940 0000000f 00000000 00000000 00000000
I/DEBUG (15581): 568ce950 00000000 00000000 00000000 00000000
I/DEBUG (15581): 568ce960 00000000 00000000 00000000 00000000
I/DEBUG (15581): 568ce970 00000000 00000000 00000000 00000000
I/DEBUG (15581): 568ce980 00000000 00000000 00000000 00000000
I/DEBUG (15581): 568ce990 00000001 00000000 49332110 00000025
I/DEBUG (15581):
I/DEBUG (15581): memory near sl:
I/DEBUG (15581): 00168e30 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e40 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e50 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e60 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e70 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e80 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168e90 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168ea0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168eb0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168ec0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168ed0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168ee0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168ef0 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168f00 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168f10 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581): 00168f20 ffffffff ffffffff ffffffff ffffffff
I/DEBUG (15581):
I/DEBUG (15581): memory near fp:
I/DEBUG (15581): 56b4d240 56948d9c 49591ed8 55527c20 56b4da70
I/DEBUG (15581): 56b4d250 00000001 ffffffff 50c29170 50c95048
I/DEBUG (15581): 56b4d260 00000000 4ca4a564 4984fd20 41203070
I/DEBUG (15581): 56b4d270 41135cf8 41135c30 50c6db90 00000001
I/DEBUG (15581): 56b4d280 56b4d260 50c95000 56b4d294 553d56e4
I/DEBUG (15581): 56b4d290 56b4d328 00000000 41135cf8 41135c28
I/DEBUG (15581): 56b4d2a0 56b4d2c4 551aee54 56b4d298 50c949e4
I/DEBUG (15581): 56b4d2b0 1d2003ca 41135c28 49850b98 56b4d2c8
I/DEBUG (15581): 56b4d2c0 56b4d300 41203018 00000000 4ca4a564
I/DEBUG (15581): 56b4d2d0 4984fd20 00000000 55527c20 56b4da70
I/DEBUG (15581): 56b4d2e0 00000001 ffffffff 50c29170 568ce8c0
I/DEBUG (15581): 56b4d2f0 00168e50 56b4d300 56b4d300 50c94ef4
I/DEBUG (15581): 56b4d300 55527c20 56b4da70 00000001 00000000
I/DEBUG (15581): 56b4d310 4ca4a564 4984fd20 50c29170 56b4d328
I/DEBUG (15581): 56b4d320 56b4d328 50c949e4 56b4d3c0 41135c28
I/DEBUG (15581): 56b4d330 4ca4a564 00000000 50c27f40 4984fd20
I/DEBUG (15581):
I/DEBUG (15581): memory near sp:
I/DEBUG (15581): 56b4d1e8 49334a40 00000000 4ca4a564 4098723f
I/DEBUG (15581): 56b4d1f8 00000000 4ca4a564 df0027ad 00000000
I/DEBUG (15581): 56b4d208 49334a40 4103b3b8 4ca4a564 409885a7
I/DEBUG (15581): 56b4d218 00000000 49334a40 56b4d22c 55fe752c
I/DEBUG (15581): 56b4d228 49588ee0 50c7396c 20c0000d 41135c00
I/DEBUG (15581): 56b4d238 49334a40 4984fd20 56948d9c 49591ed8
I/DEBUG (15581): 56b4d248 55527c20 56b4da70 00000001 ffffffff
I/DEBUG (15581): 56b4d258 50c29170 50c95048 00000000 4ca4a564
I/DEBUG (15581): 56b4d268 4984fd20 41203070 41135cf8 41135c30
I/DEBUG (15581): 56b4d278 50c6db90 00000001 56b4d260 50c95000
I/DEBUG (15581): 56b4d288 56b4d294 553d56e4 56b4d328 00000000
I/DEBUG (15581): 56b4d298 41135cf8 41135c28 56b4d2c4 551aee54
I/DEBUG (15581): 56b4d2a8 56b4d298 50c949e4 1d2003ca 41135c28
I/DEBUG (15581): 56b4d2b8 49850b98 56b4d2c8 56b4d300 41203018
I/DEBUG (15581): 56b4d2c8 00000000 4ca4a564 4984fd20 00000000
I/DEBUG (15581): 56b4d2d8 55527c20 56b4da70 00000001 ffffffff
I/DEBUG (15581):
I/DEBUG (15581): code around pc:
I/DEBUG (15581): 409885c4 4604065b d5089801 fe26f7fe f3bf6929
I/DEBUG (15581): 409885d4 50608f5e 8f5ff3bf f7fee003 692afe1d
I/DEBUG (15581): 409885e4 b11050a0 f0094620 a801ff0d fe3cf7fd
I/DEBUG (15581): 409885f4 4684bdfe 460cb537 4661a801 f7fd4615
I/DEBUG (15581): 40988604 9801fe0f f7fe4621 68ebfe07 0f40f013
I/DEBUG (15581): 40988614 d007692b f7dc18c0 4604eac4 f3bf460d
I/DEBUG (15581): 40988624 e0028f5f e9d018c0 a8014500 fe1cf7fd
I/DEBUG (15581): 40988634 46294620 bd30b003 b5374684 a801460c
I/DEBUG (15581): 40988644 46154661 fdecf7fd 98014621 fde4f7fe
I/DEBUG (15581): 40988654 f01368eb 692b0f40 18c3bf04 d002681c
I/DEBUG (15581): 40988664 f3bf58c4 a8018f5f fdfef7fd bd3e4620
I/DEBUG (15581): 40988674 b5374684 a801460c 46154661 fdd0f7fd
I/DEBUG (15581): 40988684 98014621 fdc8f7fe f01368eb 692b0f40
I/DEBUG (15581): 40988694 18c2bf02 685558c4 18c0d006 ea80f7dc
I/DEBUG (15581): 409886a4 460d4604 8f5ff3bf f7fda801 4620fddd
I/DEBUG (15581): 409886b4 b0034629 4684bd30 460cb537 4661a801
I/DEBUG (15581):
I/DEBUG (15581): code around lr:
I/DEBUG (15581): 4098721c b5704b39 460e447b d0652900 0203f001
I/DEBUG (15581): 4098722c d0142a02 d02c2a03 d14b2a01 f7de30a8
I/DEBUG (15581): 4098723c 4604e950 d1582800 46334930 20064a30
I/DEBUG (15581): 4098724c 447a4479 eb68f7d3 fd1af7fb 4a2de04d
I/DEBUG (15581): 4098725c f505589d f7d37056 f505eb96 4631704c
I/DEBUG (15581): 4098726c e936f7de b9484604 46334927 20064a27
I/DEBUG (15581): 4098727c 447a4479 eb50f7d3 fd02f7fb 7056f505
I/DEBUG (15581): 4098728c 4820e01d f505581d f7d37057 f505eb7c
I/DEBUG (15581): 4098729c 46317051 e91cf7de 42984b15 d00b4604
I/DEBUG (15581): 409872ac 491bb958 4a1b4633 44792006 f7d3447a
I/DEBUG (15581): 409872bc f7fbeb34 e000fce5 f5052400 f7d37057
I/DEBUG (15581): 409872cc e012eb68 c050f8df 400cf853 b95978e1
I/DEBUG (15581): 409872dc 46334912 20054a12 4c064479 f7d3447a
I/DEBUG (15581): 409872ec f7fbeb1c e000fccd 46204634 bf00bd70
I/DEBUG (15581): 409872fc dead1234 dead4321 0005fa74 000440b2
I/DEBUG (15581): 4098730c 000488f8 fffffe60 00044082 00048901
I/DEBUG (15581): !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 17070
I/ActivityManager( 550): Process com.thenightafterdoomsday.nomercy (pid 17070) (adj 0) has died.
W/ActivityManager( 550): Force removing ActivityRecord { 42f5eb80 u0 com.thenightafterdoomsday.nomercy / com.unity3d.player.UnityPlayerActivity}: app died, no saved state
W/ActivityManager( 550): mDVFSHelper.acquire()
W/ActivityManager( 550): Permission denied: checkComponentPermission() owningUid=10030
W/ActivityManager( 550): Permission denied: checkComponentPermission() owningUid=10031
W/ActivityManager( 550): mDVFSHelper.release()
E/dalvikvm( 128): adjustAdaptiveCoef max=4194304, min=1048576, ut=312
我把它过滤到了我认为有用的东西...... 第二种方法:
public void ConnectWiFiHardWay()
{
try
{
using (AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"))
{
using (var wifiManager = activity.Call("getSystemService", "wifi"))
{
using (AndroidJavaObject classObj = wifiManager.Call("getClass"))
{
using (AndroidJavaObject wifiConfiguration = new AndroidJavaObject("setWifiApEnabled"))
{
wifiConfiguration.Set("SSID", meSSID); // string
wifiConfiguration.Set("preSharedKey", mePassword);
using (AndroidJavaObject wifiCfgClass = wifiConfiguration.Call("getClass"))
{
using (AndroidJavaObject booleanObj = new AndroidJavaObject("java.lang.Boolean"))
{
using (AndroidJavaObject booleanClass = booleanObj.Call("getClass"))
using (AndroidJavaObject methodObj = classObj.Call("getMethod", "setWifiApEnabled", wifiCfgClass, booleanClass))
{
methodObj.Call("invoke", wifiManager, wifiConfiguration, enabled);
}
}
}
}
}
}
}
}
catch (System.Exception E)
{
T.text += "\nH - " + E.Message;
T.text += "\n\t" + E.StackTrace+"\n";
}
这个引发了一个异常,说
无法找到
如果有帮助,我可以发布完整的错误文本。
我还遵循了this question's条款。setWifiApEnabled