访问从Android的外部数据库,而无需使用PHP脚本 [英] Access external database from android without using php scripts

查看:96
本文介绍了访问从Android的外部数据库,而无需使用PHP脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一家大公司工作的学生。

I work as a student in a big company.

该公司问我能不能做一个Android应用程序,显示一些统计数据。

The company has asked if i could make an android app that shows some statistics.

我需要得到的统计数据是对我们公司的内部数据库和Android应用的用户(由是我们的内部网络上出现,并应每说有机会获得我们的内部数据),我们的建筑中使用它。

The statistics i need to get is on our company internal database and the user of the android app will use it within our building (there by being on our internal network and should per say have access to our internal data).

现在我无法PHP脚本添加到我们公司的网站,因为我们在ASP跑,我有ASP没有的experiance,我不认为我允许改变任何现有的ASP网站。

Now i am UNABLE to add PHP scripts to our company's website because we run on ASP, I have no experiance with ASP and i do not think that i am allowed to alter any of the existing Asp sites.

是否有可能对我来说,从Android设备访问我们的数据库?还是你必须要经过一个网站,为你做的数据库请求?

Is it possible for me to access our database from the android device? Or do you HAVE to go through a website that does the database request for you?

推荐答案

创建一个基于这个平台的应用程序:的https:/ /cordova.apache.org/

Create your application based in this platform: https://cordova.apache.org/

通过科尔多瓦,您可以根据HTML,CSS和Javascript开发应用。通过使用Javascript可以使就像如果你在访问互联网承载的PHP页面PHP请求到公司的数据库。

With Cordova, you can create your app based on HTML, CSS and Javascript. By using Javascript you can make PHP requests to the company's database just like if you were accessing an PHP page hosted in the internet.

下面是如何在Eclipse项目可能看起来像。

Here is how your Eclipse project may look like.

下面是你的HTML页面的摘录。

Here is an excerpt of your html page.

的index.html

<body>
    <div id="main">
        <span id="screen1"></span>
    </div>

    <script>
    $(document).ready(function(){
        //first php query
        $.post('http://www.example.com/request.php', function(retorno_busca){
            $('#screen1').html(retorno_busca);  
        });
    }); 

    </script>
</body>

您需要的地方承载在互联网上一些PHP code,不一定在你的公司的网站。

You will need to host some PHP code somewhere in the internet, not necessarily in your's company's website.

花一些时间了解科尔多瓦。

Spend some time learning about Cordova.

这篇关于访问从Android的外部数据库,而无需使用PHP脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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