如何在穆斯林祈祷时间的计算方法在Android应用程序? [英] How is the Muslim Prayer time is calculated in an android application?

查看:245
本文介绍了如何在穆斯林祈祷时间的计算方法在Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做我的单项目,旨在开发一个Android应用程序。我已决定开发,告诉用户日常次祈祷的穆斯林的应用程序。但由于我是新到Android(也编程一般),我不知道如何实现这一点。我做了一些研究,我发现,有些网络服务提供JSON或XML文件获取数据,或有认为是Java工具/库,来使用。有没有谁开发或在这些议题经验的人。

请给一些建议。

谢谢

解决方案

Xhanch API 返回JSON / XML格式的数据给你。

如果你想XML,

<$p$p><$c$c>http://api.xhanch.com/islamic-get-prayer-time.php?lng=30&lat=30&yy=2013&mm=9&gmt=4

如果你想JSON,

<$p$p><$c$c>http://api.xhanch.com/islamic-get-prayer-time.php?lng=30&lat=30&yy=2013&mm=9&gmt=4&m=json

检查 每个的意义文档 请求参数

您可以调用API使用的 KSOAP 2库

这是怎样的JSON响应看起来像

<$c$c>{"1":{"fajr":"05:16","sunrise":"06:36","zuhr":"13:00","asr":"16:34","maghrib":"19:23","isha":"20:40"},"2":{"fajr":"05:16","sunrise":"06:37","zuhr":"13:00","asr":"16:34","maghrib":"19:22","isha":"20:39"},"3":{"fajr":"05:17","sunrise":"06:38","zuhr":"13:00","asr":"16:33","maghrib":"19:21","isha":"20:38"},.... }

一旦你得到JSON格式的数据,所有你需要做的是 解析信息 ,并在应用程序中显示出来。

I am doing my uni project to develop an android application. I have decided to develop an application that tells the user the daily times to pray for Muslims. But as I am new to android(and also programming in general) I don't know how to implement this. I have done some research myself and found that some web services provide JSON or XML files to fetch the data or there supposed to be Java Tools/Libs to use. Is there anyone who has developed or has experience in these topics.

please give some advices.

thank you

解决方案

The Xhanch API returns the data to you in JSON/XML format.

If you want XML,

http://api.xhanch.com/islamic-get-prayer-time.php?lng=30&lat=30&yy=2013&mm=9&gmt=4

If you want JSON,

http://api.xhanch.com/islamic-get-prayer-time.php?lng=30&lat=30&yy=2013&mm=9&gmt=4&m=json

Check the documentation for the significance of each of the request parameters.

You can make a call to the API using KSOAP 2 library.

This is how the JSON response looks like

{"1":{"fajr":"05:16","sunrise":"06:36","zuhr":"13:00","asr":"16:34","maghrib":"19:23","isha":"20:40"},"2":{"fajr":"05:16","sunrise":"06:37","zuhr":"13:00","asr":"16:34","maghrib":"19:22","isha":"20:39"},"3":{"fajr":"05:17","sunrise":"06:38","zuhr":"13:00","asr":"16:33","maghrib":"19:21","isha":"20:38"},.... }

Once you get the data in JSON format, all you need to do is parse the information and display it in your application.

这篇关于如何在穆斯林祈祷时间的计算方法在Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆