dqy1265 2012-10-02 09:50
浏览 10

从PHP返回Java客户端的值

I am a beginner in Java and PHP.

I made a client Java app that uses webView to Pass a string to php client page which will insert this string to the DB.

my question is, how can I return a false value to the java client app in case the PHP failed to insert the string to the DB using webView.

the php code will be something like this:

 if(Insertion suceed)
{return true;}  

else {return false;}

but I dont know how to make it in the Java side.

P.S: I need the return value to display an alert to the java user to restart the app.

  • 写回答

3条回答 默认 最新

  • douang4294 2012-10-02 09:57
    关注

    You could use PHP/Java Bridge to allow communication between your applications. You could also set up a REST service provided by PHP (see this previous SO question) and allow your Java application to consume that service. The PHP application just sends true/false as a response.

    评论

报告相同问题?

悬赏问题

  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发