當前位置:首頁 » 安卓系統 » androidguid

androidguid

發布時間: 2022-11-19 10:50:06

㈠ android調用webservice怎麼傳遞對象

1.webservice方法要傳遞參數的對象中包含了日期類型,guid類型。如下所示:

[html] view plain
POST /MyWebService.asmx HTTP/1.1
Host: 192.168.11.62
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/AddMaintenanceInfo"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddMaintenanceInfo xmlns="http://tempuri.org/">
<model>
<Id>guid</Id>
<CarId>guid</CarId>
<Cost>string</Cost>
<Dates>dateTime</Dates>
</model>
</AddMaintenanceInfo>
</soap:Body>
</soap:Envelope>

2.新建一個類CarMaintenanceInfo用於傳遞參數對象,並使其實現KvmSerializable,如下

[java] view plain
public class CarMaintenanceInfo implements KvmSerializable {

/**
* 車輛ID
*/
public String CarId;

/**
* 車輛維修費用
*/
public String Cost;

public String Dates;

@Override
public Object getProperty(int arg0) {
switch (arg0) {
case 0:
return CarId;
case 1:
return Cost;
case 2:
return Dates;
default:
break;
}
return null;
}

@Override
public int getPropertyCount() {
return 3;
}

@Override
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
switch (arg0) {
case 0:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "CarId";
break;
case 1:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "Cost";
break;
case 2:
arg2.type = PropertyInfo.STRING_CLASS;
arg2.name = "Dates";
break;
default:
break;
}
}

@Override
public void setProperty(int arg0, Object arg1) {
switch (arg0) {
case 0:
CarId = arg1.toString();
break;
case 1:
Cost = arg1.toString();
break;
case 2:
Dates = arg1.toString();
break;
default:
break;
}

}

}

注意:getPropertyCount的值一定要與該類對象的屬性數相同,否則在傳遞到伺服器時,伺服器收不到部分對象的屬性。

3.編寫請求方法,如下:

[java] view plain
public boolean addMaintenanceInfo(Context context) throws IOException, XmlPullParserException {

String nameSpace = "http://tempuri.org/";
String methodName = "AddMaintenanceInfo";
String soapAction = "http://tempuri.org/AddMaintenanceInfo";

String url = "http://192.168.11.62:6900/MyWebService.asmx?wsdl";// 後面加不加那個?wsdl參數影響都不大

CarMaintenanceInfo info = new CarMaintenanceInfo();
info.setProperty(0, "9fee02c9-8785-4b49-b389-58ed6562c66d");
info.setProperty(1, "12778787");
info.setProperty(2, "2013-07-29T16:45:20");

// 建立webservice連接對象
org.ksoap2.transport.HttpTransportSE transport = new HttpTransportSE(url);
transport.debug = true;// 是否是調試模式

// 設置連接參數
SoapObject soapObject = new SoapObject(nameSpace, methodName);
PropertyInfo objekt = new PropertyInfo();
objekt.setName("model");
objekt.setValue(info);
objekt.setType(info.getClass());
soapObject.addProperty(objekt);

// 設置返回參數
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);// soap協議版本必須用SoapEnvelope.VER11(Soap
// V1.1)
envelope.dotNet = true;// 注意:這個屬性是對dotnetwebservice協議的支持,如果dotnet的webservice
// 不指定rpc方式則用true否則要用false
envelope.bodyOut = transport;
envelope.setOutputSoapObject(soapObject);// 設置請求參數
// new MarshalDate().register(envelope);
envelope.addMapping(nameSpace, "CarMaintenanceInfo", info.getClass());// 傳對象時必須,參數namespace是webservice中指定的,

// claszz是自定義類的類型
try {
transport.call(soapAction, envelope);
// SoapObject sb = (SoapObject)envelope.bodyIn;//伺服器返回的對象存在envelope的bodyIn中
Object obj = envelope.getResponse();// 直接將返回值強制轉換為已知對象
Log.d("WebService", "返回結果:" + obj.toString());

}
catch (IOException e) {
e.printStackTrace();
}
catch (XmlPullParserException e) {
e.printStackTrace();
}
catch (Exception ex) {
ex.printStackTrace();
}

return true;

// 解析返回的結果
// return Boolean.parseBoolean(new AnalyzeUtil().analyze(response));
}

注意:傳遞date類型的時候其實可以使用Date而不是String。但是需要修改幾個地方
1.CarMaintenanceInfo類中的getPropertyInfo(),將arg2.type = PropertyInfo.STRING_CLASS修改為MarshalDate.DATE_CLASS;
2. 在請求方法中的 envelope.setOutputSoapObject(soapObject);下加上 new MarshalDate().register(envelope);
雖然可以使用Date,但是傳到伺服器上的時間與本地時間有時差問題。

當Android 調用webservice,請求參數中有日期,guid,double時,將這些類型在添加對象前轉換為字元串即可。

[java] view plain
// 構造request
SoapObject request = new SoapObject(PublishInfo.NAMESPACE, "GetCarListByRegion");
request.addProperty("leftTopLat", String.valueOf(leftTopLat));
request.addProperty("leftTopLng", String.valueOf(leftTopLng));
request.addProperty("rightBottomLat", String.valueOf(rightBottomLat));
request.addProperty("rightBottomLng", String.valueOf(rightBottomLng));

當需要傳遞一個伺服器對象參數時.
[html] view plain
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetLicenseDetails xmlns="http://tempuri.org/">
<companyId>guid</companyId>
<licenseNos>
<string>string</string>
<string>string</string>
</licenseNos>
<pageOptions>
<page>int</page>
<rows>int</rows>
<total>int</total>
<sort>string</sort>
<order>string</order>
<skip>int</skip>
<Remark>string</Remark>
</pageOptions>
</GetLicenseDetails>
</soap:Body>
</soap:Envelope>

[java] view plain
public ListPageResult<LicenseInfo> getLicenseDetails(String[] licenseNos, int page, int rows, int total) {
// 構造request
SoapObject request = new SoapObject(PublishInfo.NAMESPACE, "GetLicenseDetails");
// 許可證列表
SoapObject deviceObject = new SoapObject(PublishInfo.NAMESPACE, "GetLicenseDetails");
if (licenseNos != null && licenseNos.length > 0) {
for (int i = 0; i < licenseNos.length; i++) {
if (!"".equals(licenseNos[i])) {
deviceObject.addProperty("string", licenseNos[i]);
}
}
request.addProperty("licenseNos", deviceObject);
}
else {
request.addProperty("licenseNos", null);
}
// 分頁數據
SoapObject optionObject = new SoapObject(PublishInfo.NAMESPACE, "PageOptions");
optionObject.addProperty("page", page);
optionObject.addProperty("rows", rows);
optionObject.addProperty("total", total);
optionObject.addProperty("sort", null);
optionObject.addProperty("order", "desc");
optionObject.addProperty("skip", 0);
optionObject.addProperty("Remark", null);
request.addProperty("pageOptions", optionObject);
// 獲取response
Object response = sendRequest(context, request);
if (!mNetErrorHanlder.hasError(response)) { return ObjectAnalyze.getLicenseDetails(response); }
return null;
}

㈡ 怎樣獲取安卓應用guid

http://dl.21ic.com/download/android-programmers-guid-ic-24986.html

不知是否幫助到你?如有幫助請採納,如有疑問請交流!

㈢ 安卓天堂島如何刪除ID

用RE文件管理器進\data\data\com.seventeenbullets.androidE直接刪除GUID和INSTALLATION,直接把GUID和INSTALLATION刪除,新的ID就出來啦

安卓模擬器怎麼獲取ROOT許可權

1、在root之前,將安卓模擬器徹底關閉,包括任務管理器中的進程(一般都是HD-開頭的關於模擬器的進程,都關閉掉);

2、然後下載root工具箱(裡麵包含和img、su、reg、tools有關的文件);

3、檢查一下自己的GUID,具體方法是:WIN鍵+R→regedit→回車鍵→[HKEY_CURRENT_USERSoftwareBlueStacks]注意「USER_GUID」="這里是指一些帶有間隔的數字,每一個人都是不一樣的,先復制下來這些數字,會有用的。

4、第四步,然後找到准備導入的注冊表文件,選擇滑鼠右鍵【編輯】

5、將剛才第三步中復制出來的一串數字添加到注冊表文件中,有兩個地方需要修改


第11步:退出adb工具,點叉關閉即可。

然後退出bluestacks並重啟,

㈤ android 怎麼生成guid

使用java的UUID就可以了,
UUID uuid = UUID.randomUUID();
System.out.println(".{"+uuid.toString()+"}");
http://ke..com/link?url=_YODmqQ6J6XIchlBxuyCkWO--k-ADCrzmPaLQFAuRkOX1d_e

㈥ Android上大文件分片上傳 具體怎麼弄

正常情況下,一般都是在長傳完成後,在伺服器直接保存。

?

1
2
3
4
5
6
7

public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
//保存文件
context.Request.Files[0].SaveAs(context.Server.MapPath("~/1/" + context.Request.Files[0].FileName));
context.Response.Write("Hello World");
}

最近項目中用網路開源的上傳組件webuploader,官方介紹webuploader支持分片上傳。具體webuploader的使用方法見官網http://fex..com/webuploader/。

?

1
2
3
4
5
6
7
8
9
10
11
12

var uploader = WebUploader.create({
auto: true,
swf:'/webuploader/Uploader.swf',
// 文件接收服務端。
server: '/Uploader.ashx',
// 內部根據當前運行是創建,可能是input元素,也可能是flash.
pick: '#filePicker',
chunked: true,//開啟分片上傳
threads: 1,//上傳並發數
//由於Http的無狀態特徵,在往伺服器發送數據過程傳遞一個進入當前頁面是生成的GUID作為標示
formData: {guid:"<%=Guid.NewGuid().ToString()%>"}
});

webuploader的分片上傳是把文件分成若干份,然後向你定義的文件接收端post數據,如果上傳的文件大於分片的尺寸,就會進行分片,然後會在post的數據中添加兩個form元素chunk和chunks,前者標示當前分片在上傳分片中的順序(從0開始),後者代表總分片數。

㈦ 如何安裝AndroidBootloaderInterface驅動

Win8 64位系統最簡單的adb安裝方法
把android-sdk里platform-tools目錄的下面四個文件分別復制到C:\Windows\System32和C:\Windows\SysWOW64\這兩個系統目錄即可。
四個文件為:
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
fastboot.exe
可能一些朋友在xp上安裝正常,但在Win 864位系統上安裝就出現了問題,這是為什麼?根據錯誤信息"系統找不到指定文件"的感到疑惑,於是打開inf信息文件,看看究竟;;
; Android WinUsb driver installation.;
[Version]
Signature = "$Windows NT$"
Class = AndroidUsbDeviceClass
ClassGuid = {3F966BD9-FA04-4ec5-991C-D326973B5128}
Provider = %ProviderName%
DriverVer = 12/06/2010,4.0.0000.00000
CatalogFile.NTx86 = androidwinusb86.cat
CatalogFile.NTamd64 = androidwinusba64.cat
;
; This section seems to be required for WinUsb driver installation.
; If this section is removed the installer will report an error
; "Required section not found in INF file".
;
[ClassInstall32]
Addreg = AndroidWinUsbClassReg
[AndroidWinUsbClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-1
[Manufacturer]
%ProviderName% = Google, NTx86, NTamd64
[Google.NTx86]
;OMAP3/4
%CompositeAdbInterface% = USB_Install, USB\Class_FF&SubClass_42&Prot_01
%SingleAdbInterface% = USB_Install, USB\Class_FF&SubClass_42&Prot_03
[Google.NTamd64]
;OMAP3/4
%CompositeAdbInterface% = USB_Install, USB\Class_FF&SubClass_42&Prot_01
%SingleAdbInterface% = USB_Install, USB\Class_FF&SubClass_42&Prot_03
[USB_Install]
Include = winusb.inf
Needs = WINUSB.NT
[USB_Install.Services]
Include = winusb.inf
AddService = WinUSB,0x00000002,WinUSB_ServiceInstall
[WinUSB_ServiceInstall]
DisplayName = %WinUSB_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys
[USB_Install.Wdf]
KmdfService = WINUSB, WinUSB_Install
[WinUSB_Install]
KmdfLibraryVersion = 1.9
[USB_Install.HW]
AddReg = Dev_AddReg
[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{F72FE0D4-CBCB-407d-8814-9ED673D0DD6B}"
[USB_Install.CoInstallers]
AddReg = CoInstallers_AddReg
CopyFiles = CoInstallers_CopyFiles
[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
HKLM,System\CurrentControlSet\Control\CoDeviceInstallers, \
{3F966BD9-FA04-4ec5-991C-D326973B5128},0x00010008, "USBCoInstaller.dll,Zoom2_CoInstaller"
; above line uses the line continuation character (\)
[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01009.dll
USBCoInstaller.dll
[DestinationDirs]
CoInstallers_CopyFiles=11
[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64
[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll = 1
WdfCoInstaller01009.dll = 1
USBCoInstaller.dll = 1
[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll = 2
WdfCoInstaller01009.dll =
USBCoInstaller.dll = 2
[Strings]
ProviderName = "Google, Inc."
SingleAdbInterface = "Android ADB Interface"
CompositeAdbInterface = "Android Composite ADB Interface"
SingleBootLoaderInterface = "Android Bootloader Interface"
WinUSB_SvcDesc = "Android USB Driver"
DISK_NAME = "Android WinUsb installation disk"

ClassName = "Android Tablet"
------------------------------------------------------------------------------------------------------------------
根據
[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64
判斷,因amd64不存在導致, 錯誤信息"系統找不到指定文件"。於是新建amd64文件夾將i386的文件復制到amd68,最後的結果成功安裝驅動。

㈧ Android Studio安卓模擬器怎麼用

1
首先,開啟 Hyper-V 虛擬化技術(已經開啟的無視);
① 選中 控制面板->卸載程序->啟動或關閉Windows功能->Hyper-V->確定

2
下載完後是一個40M左右的 vs_emulatorsetup.exe 文件,不包含安卓模擬器的鏡像文件,安裝的時候會默認在線下載API 19(Andorid 4.4)的x86鏡像,後續你也可以單獨再下載其他的API xx版本,另外說明一下, Visual Studio Emulator for Android是不依賴Visual Studio的,也就是說可以單獨安裝使用,Android Studio是使用adb作為橋梁來連接 Visual Studio Emulator for Android 。
安裝步驟我就不列出來了, 記得安裝後重啟(它需要把自己加入Hyper-V Administrators的管理員組裡面) 。
安裝重啟後打開 Visual Studio Emulator for Android ,如下所示:

3
如果你啟動了模擬器,則會在Hyper-V裡面自動創建出對應的x86的Android虛擬機來,筆者的如下:

4
2.設置Andorid Studio使其可以使用這些模擬器
打開Android Studio> Run > Edit Configurations > Defaults / Android Application /General 選項卡的 Target Device 節點,勾選 Show chooser dialog 和 Use same device for future launches 。 記得不要忘記點Apply和OK。 如下圖:

3. 為Android Studio添加啟動模擬器的快捷按鈕
雖然在Visual Studio Emulator for Android的管理器窗口中可以啟動模擬器,但是每次都要到這裡面去打開還是比較繁瑣的,故而我們為Android Studio添加一個啟動Visual Studio Emulator for Android的快捷按鈕。
3.1 配置External Tools
打開 File > Settings > External Tools > Add :

Name:隨便寫,方便你認出來就好,筆者的是 VS Emulator (4.4 API 19) 。
Program:填寫Visual Studio Emulator for Android安裝目錄下的emulatoecmd.exe的絕對路徑,就是用它來啟動模擬器的。筆者的是 C:\Program Files (x86)\Microsoft Emulator Manager\1.0\emulatorcmd.exe 。
Parameters:添加啟動模擬器的參數,/sku:Android是說明打開Android的模擬器,/id:後面的Guid是模擬器的唯一 編號, 總的意思是指定要啟動哪一個Android模擬器。 id可以通過 emulatorcmd.exe /sku:Android list /type:device 獲得,如下:

Working Directory:指定工作目錄,應該是可以隨便填寫的。筆者的是$ProjectFileDir$。
3.2 添加按鈕到Toolbar
在toolbar空白處點擊右鍵,選擇 Customize Menus and Toolbars 。然後導航到Main Toolbar > Add After >在彈出的面板中找到 External tool > VS Emulator (4.4 API 19) 然後按 OK 。 如下:

然後點擊我們新添加的按鈕了,就可以啟動Android模擬器了:

4. 為Android Studio添加Contect模擬器的快捷按鈕
第三節的按鈕只是啟動了模擬器,但是Andorid Studio還無法連接到模擬器,這里就要使用adb命令來連接到剛才啟動的模擬器上 。
4.1配置External Tools
同樣是添加一個快捷按鈕,步驟和第三部一樣,只是參數不同,這里我就只把參數列出來了:
Name:隨便寫,方便你認出來就好,筆者的是 adb Connect (VS Emulator) 。
Program:填寫adb.exe的絕對路徑,筆者的是 D:\_android\sdk\platform-tools\adb.exe 。
Parameters:添加adb.exe的參數,connect ip:5555;筆者的是 192.168.2.233:5555。ip可以通過打開模擬器在wifi中查看,也可以在模擬器的設置中network中查看

Working Directory:指定工作目錄,應該是可以隨便填寫的。筆者的是$ProjectFileDir$ 。
4.2添加按鈕到Toolbar
步驟和3.2一樣的,這里就不再解釋了。貼個圖吧:

5.用Visual Studio Emulator for Android調試Android App
按下 Run 按鈕(綠色箭頭那個...),彈出選擇Android設備的選擇框:

OK啦,大功告成:

6. 進一步完善
每次調試前都要點一下 啟動模擬器 的按鈕,等模擬器啟動然後再點擊 contect模擬器的按鈕,然後才能點 run調試 ,,,好繁瑣。
我們來配置一下run之前要執行的命令,讓run按鈕把這三件事都做了!
打開 Run > Edit Configurations > Defaults / Android Application / Emulator 選項卡的BeforeLaunch 節點, 把我們剛才創建的兩個 External Tool 添加到此處 , 記得不要忘記點Apply和OK,順序如下:

以上就是為大家帶來的Windows 10安卓模擬器使用的方法,希望可以幫助到大家。

㈨ macbook os x 系統如何修改安卓模擬器guid

重新裝一個就可以.這東西很容易出錯的

熱點內容
福睿斯配置怎麼樣 發布:2024-05-06 06:50:16 瀏覽:101
微生物資料庫 發布:2024-05-06 06:47:33 瀏覽:603
原神和steam游戲哪個需要配置 發布:2024-05-06 06:37:40 瀏覽:664
nginx訪問403 發布:2024-05-06 05:56:39 瀏覽:677
android上傳圖片參數 發布:2024-05-06 05:56:04 瀏覽:221
360控制上傳流量 發布:2024-05-06 05:38:11 瀏覽:999
幾代演算法 發布:2024-05-06 05:33:43 瀏覽:353
安卓怎麼查看iculd照片 發布:2024-05-06 05:18:24 瀏覽:91
shell腳本減法 發布:2024-05-06 05:18:22 瀏覽:353
中文解壓縮文件 發布:2024-05-06 05:13:24 瀏覽:197