I made an app using jquery mobile, php and mysql and now I'm trying to convert into .apk file using phonegap for desktop.
But I have a problem with my php code because it doesn't work, phonegap doesn't recognize php code.
Is there a way can do it to convert both jquery mobile code and php & mysql into .apk?
I will post the whole code if it's necessarily or another way to do this, please help!
Unfortunately not.
You would have to separate your server-side and client-side code.
HTML & jQuery Mobile would be your client, which you could turn into your app.
PHP & mySQL would be your server, which you could not put in your app.
You would then communicate between the client and the server by calling Ajax in client code, you might also like to use a framework like CakePHP on the server.
Good luck!!
Related
I need help to programming an App that need a data from SQL Server and somehow I have to update the data too. The app will be a client side and the server will have all the database. did BB allow us to connect to PHP directly or I need to make a HTML so that page will run the JS?.
Can anyone help me, where I can find the demo? or sample about Sql and app?
I have already install eclipse and Blackberry SDK 7.1.
Lets assume you are building a horoscope app:
You input a date and zodiac sing and you get your horoscope from the server.
In this case, your client can be build from few HTML pages styled with CSS.
If you need something more fancy you can use JavaScript.
On the server side, you will need running DataBase, and support for PHP (running Apache).
In the simple variant your client will send requests (from a Form or Ajax) to
www.myServer.com/my_php_back_end.php and will display the response.
This is just a simple scenario so you can form your question better.
PHP_MySQL-Creating-Form
I am new to Twitter Bootstrap and I included some simple PHP script to test and my browser (Chrome) won't read the php code. I have saved the file .html, .php, and tried .html.php. Is it that Twitter Bootstrap only works with client side, not server side apps, or is there a trick to get it to work with PHP?
Thanks
Does Twitter Bootstrap work with PHP?
Yes and no.
Bootstrap is entirely client side. It can be output by PHP (just like any other client side code) but has no special features for interacting with it.
my browser (Chrome) won't read the php code
PHP is a server side language. No browser parses PHP code. You need to access it through a web server that will execute the PHP and return the output to the browser. See also installing PHP.
Bootstrap is just some css and javascript. You can use it with a PHP app just fine. We do.
Use Microsoft WebMatrix 3 (installing php and Wamp servers is really very annoying)
Use Webmatrix IDE and then php and bootstrap will work just fine..
I have a php page which connects an API and gets information back which can then be displayed.
I'd like to turn this into an app for Android. I've heard of PhoneGap, which I know uses javascript, html, and css. I know javascript is capable of calling php files, but I am unsure how or if its even possible to call a php file from an android device. I'm not sure if android browsers can handle php, or what the deal is with them. So if you have any information on that, I'd appreciate it.
I'm also willing to rewrite the API call in javascript, but I don't think thats possible. If you think differently, please let me know what you're talking about.
Android cannot talk directly to PHP. What phonegap, javascript, etc.. are doing is simply issuing HTTP requests that happen to be handled by a PHP script.
The PHP code will execute, output some data (json, html, xml, gif, jpg, etc...) and send that out as a the HTTP request's reply.
PHP is just a server side language so it doesn't matter if your browser "can or cannot" handle it, only HTML is returned (unless you set a different content-type).
You may be worth while looking into REST style JSON api's which would allow a XMLRequest to be sent to. Have a look at this document
Theres also a nice tutorial here which shows how to call a REST API and a PHP Tutorial here to create a REST API.
1.It dosent matter to PhoneGap where the PHP is hosted or Its PHP OR ASP.NET OR ASP.NET MVC
2.If You wanna host your PHP code yourself in production (You mayb shouldn't do this in production). then you need a server and a static IP address
3.if you just wanna setup a PHP server for developmental purposes then just tie it to 127.0.0.1:81 and you can directly use this address it doesn't matter whether you have a static IP address or not.
I have done this with phonegap using jsonp
http://en.wikipedia.org/wiki/JSONP
Works great
I am working on a Android Application that has web view where i need to load html, jquery and js and php also. Now i am able to load html jquery css javascript , But my problem is i am unable to load php in web view in offline is there any way to execute php in web view
Please Help Me Thanks In Advance
You almost certainly don't want to run PHP on your Android. But in case you do, then you would want http://code.google.com/p/php-for-android/. Better link: http://phpforandroid.net/
PHP is a server side language. It cannot run inside the browser. It helps you to build the dynamic web pages.
You can call any web page in the webview when you are online. it doesn't matter what is the server side language.
When you are offline, you cannot send request to any server. so no question of executing any page.
You can do it easyly with AndroPhp, just search it in Google play and install.
Its like WampServer for Php+Mysql. You should run it than just create your PHP project under www/ folder and call it from Android webview 127.0.0.1:80/yourproject
This way you you have local server on your Android, you shouldnt code in Java for Android all you can code in PHP. Maybe it is not a elegant way to code for Android but works !!
For javascript and html files only, Dreamweaver's build app for android function seems to work great in cs 5.5. But when any php code is put in (for authentication, or for ajaxing in web service returns ) it seems that the android app just displays broken php code instead of executing it. When building the app, Dreamweaver won't even let you use a root php file in the project; it only seems to only accept html files.
Am I doing something wrong? Building apps out of web language-based files seems a lot less useful if server-side code isn't allowed.
Are there any other alternatives? Titanium studio looks really complicated, but I'm willing to read the docs if it's worth the time.
http://help.adobe.com/en_US/dreamweaver/cs/using/WSeffff8bffc80208478c8d43312e240fe0ad-8000.html
Indeed it only packages HTML, CSS and Javascript into an Android or iOS package.
I'm afraid you'll have to learn real Android development if you want something more complex.
Dreamweaver will package the files up just like you asked, however, the destination system is what runs the code. Android doesn't execute the PHP within the app. Your app has to connect with a remote server that is to handle the log in. Thinks of two separate apps, one on the phone and one on your server.
Android doesn't execute the PHP within the app. This is because PHP is a server side client and Not client side. Unless they create some inbuit servers within phones from which native apps can tap into. One option you can use is to use html files and within them, create links to php files which are in online servers so as to have your scripts executed.