Java - How to Retrieve and use a single value from azure mobile services in Android

前端 未结 3 449
情深已故
情深已故 2021-01-21 02:25

I am new to azure but i know certain things like how to retrieve and store data to azure , i followed azure official documentation for this purpose.

Link is Here - https

3条回答
  •  自闭症患者
    2021-01-21 02:48

    The most optimal solution would be to create an api on your server which accepts an ID to return an single object/tablerow.

    In your android app, you only have to call:

    MobileServiceTable mYourTable;
    
    mClient = new MobileServiceClient(
                            "https://yoursite.azurewebsites.net/",
                            mContext);
    mYourTable = mClient.getTable(YourClass.class);
    YourClass request = mYourTable.lookUp(someId).get(); 
    // request -> https://yoursite.azurewebsites.net/tables/yourclass/someId
    

    YourClass should have the same properties as the object on the server.

提交回复
热议问题