how to display graph in android using MySQL database

余生颓废 提交于 2019-12-01 02:23:47

Yeah, this just isn't going to work. Activity.onCreate is not main(). You can't just put your application there.

I'm sure this isn't what you want to hear, by you really need to go all the way back to the drawing board. You are going to want to put the code that requests the JSON object into a Service.

The code that does the actual graphing looks pretty good. You will need to set it up so that when the Service succeeds in retrieving the JSON, and then parsing it, it notifies the Activity that there is something to graph.

Step back from the code and brush up on Android architecture for a couple days. It isn't hard, but it is different.

Yes.It will be possible. you can follow my example

Bar Chart in Android With out any Built in jars. Here you can get data from database and try to set the results in the arrays(Say grossSal,netSal,datelabel arrays)

Here is the simple logic with no jars needed. you can implement bar charts with your own coding from this example

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!