duangao7133 2011-11-25 20:52
浏览 51

在ListView中从php服务器检索mysql数据到android

I would like to know if there is any way to retrieve or load database from MySql to the Android app? So far most of them includes JSON etc. Is it a must to involve JSON? Is there any alternative way?

I am able to post data to the database. I would like to know if I can view the table of the database or any info from the database from the Android app directly.

My aim is to view all directory and files available in the web server. User can enter the directory or file while browsing. It would be good if it is listed in ListView etc?

  • 写回答

2条回答 默认 最新

  • dongwu8653 2011-11-25 21:39
    关注

    I have seen forum posts of undocumented MySQL JDBC drivers created for test and academic purposes. Just a quick search on google for "Android JDBC MySQL" will get you to some of these. However, you would not typically want to connect directly to a database over the web on your mobile device, bad idea (for a host of reasons). Instead you might look at creating an interface for whatever data it is you want to access and exposing it as a service (SOAP, REST, anything else). Then you can use a variety of plain Java APIs to get/ put/update/delete/whatever your data. What you want is more like the Google Data APIs, for your own stuff, rather than trying to include all sorts of JDBC overhead on a phone (keep all of that on the server, and use it like you normally would).

    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败