Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在room数据库和mysql数据库中存储数据下面是我的代码_Android_Mysql_Database_Retrofit - Fatal编程技术网

Android 如何在room数据库和mysql数据库中存储数据下面是我的代码

Android 如何在room数据库和mysql数据库中存储数据下面是我的代码,android,mysql,database,retrofit,Android,Mysql,Database,Retrofit,这是我的应用改造界面 @FormUrlEncoded @POST("sendorder.php") Call<order> sendOrder(@Field("name") String name, @Field("link") String link, @Field("amount") int amount, @Field("price") double price); 为什么你的应用程序需要2分贝?是的,这是可能的。您需要将数据发送到服务器。当连接不可用时,您还需要缓存数据,然

这是我的应用改造界面

@FormUrlEncoded
@POST("sendorder.php")
Call<order> sendOrder(@Field("name") String name,
@Field("link") String link,
@Field("amount") int amount,
@Field("price") double price);

为什么你的应用程序需要2分贝?是的,这是可能的。您需要将数据发送到服务器。当连接不可用时,您还需要缓存数据,然后在连接可用时发送。我们计划只使用room db创建应用程序的用户和服务器端,但我们的顾问要求我们创建服务器端web。但是我们没有一个想法如何创建房间。我们应该删除房间数据库并专注于mysql吗?
builder.setNegativeButton("CONFIRM", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialogInterface, int i) {
  dialogInterface.dismiss();
  try {
    mService = Common.getAPI();
    Cart cartItem = new Cart();
    cartItem.name = txt_product_dialog.getText().toString();
    cartItem.amount = Integer.parseInt(number);
    cartItem.price = finalPrice;
    cartItem.link = foodList.get(position).Link;
    Common.cartRepository.insertToCart(cartItem);
    Log.d("KANZEN_DEBUG", new Gson().toJson(cartItem));
    Toast.makeText(context, "Successfully Added To Your Order!",Toast.LENGTH_SHORT).show();
  } catch (Exception ex) {
      Toast.makeText(context, ex.getMessage(),Toast.LENGTH_SHORT).show();
  }
}});

builder.setView(itemView);
builder.show();