栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Java-如何在Android中从Azure移动服务中检索和使用单个值

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Java-如何在Android中从Azure移动服务中检索和使用单个值

我解决了。无需创建自定义API。

只需遵循基础知识,下面是代码:-

final String[] design = new String[1];private MobileServiceTable<User> mUser;mUser = mClient.getTable(User.class); new AsyncTask<Void, Void, Void>() {     @Override     protected Void doInBackground(Void... params) {         try {  final MobileServiceList<User> result =          mUser.where().field("name").eq(x).execute().get();  for (User item : result) {     // Log.i(TAG, "Read object with ID " + item.id);      desig[0] = item.getDesignation(); //getDesignation() is a function in User class ie- they are getters and setters      Log.v("FINALLY DESIGNATION IS", desig[0]);  }         } catch (Exception exception) { exception.printStackTrace();         }         return null;     }     @Override     protected void onPostExecute(Void aVoid) {         super.onPostExecute(aVoid);         designation.setText(desig[0]);     } }.execute();

不要 忘记

User
serialization
所有人创建一个类。另外,您应该定义数组。

*如果无法正常工作,请 *随时写

编辑:-

design[0]
是大小为1的数组。

eq(x)
等于
x
where,
x
变量包含要从数据库(azure)指定的用户名。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/428728.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号