How to connect PHP GAE(Google App Engine) to Google Docs, Spreadsheets - php

I have a PHP app deployed in GAE(Google App Engine)
I need to connect to Google Docs, Google Spreadsheet URL below and do all editions/manage(edit a Doc, Edit a Sheet,...etc) as like I am able to do via GAS, just like we manage the CAL API.
https://developers.google.com/apps-script/reference/document/
https://developers.google.com/apps-script/reference/spreadsheet/
What is the best approach for it? How to use those functions available in GAS via PHP GAE?
Plz someone help, a small tip would also help us.

In PHP, you can make an HTTP Request. In Apps Script, you can create a Stand Alone Apps Script project, that detects either a GET or POST request, and runs code. Then the code can do whatever you want it to do (E.g. write data to spreadsheet). When the code is done, you can have it return something back to the PHP code that called it.
So, you can use an Apps Script project as an intermediary between your PHP and a Google spreadsheet. This avoids needing to use the PHP API for Google Spreadsheets. The Apps Script file is an intermediary between your PHP code and getting data written/read from your spreadsheet. But an API is also an intermediary. So, in that sense it's the same. If you already have Apps Script code that does what you want, you can trigger it to run with a doGet() or doPost() function. And you can avoid learning the API.
For more information see the following post:
stackoverflow answer - Call a custom GAS function from external URL

Related

Call android functions through php

I have an android app but all it is, is a Webview which is displaying my website (much easier to maintain an update)
What I want do is call functions like making a payment through Google or downloading data to the app itself
Is there anyway through php to do such a thing? I searched various things on Google but they just return apps, and I'm looking for a code or maybe some sdk
PHP code runs on your server, not on the client, so there is no way to do it that way.
This will help: https://developer.android.com/guide/webapps/webview.html

Creating an Android app using PHP

I'm going to create an Android app for the first time, and I wanted to do it in PHP, I've done some research and found the likes of PhoneGap, but I'm still quite short in the area, could someone give me a start?
What I'm going to be doing is a simple app for testing, a shop where you search for products, add them to your cart and check out, and the names of the products you ordered will be entered to a database.
Basically;
Search for products->add to cart->check out->info sent to database (all through PHP).
Where should I start?
Cordova is mainly a JavaScript framework that exposes native device features as JavaScript functions. Think of a cordova application like a plain HTML & Javascript website running in a Webview within your mobile application. The PHP interpreter isn't available on a mobile device, which is why you cannot package PHP files into a cordova app and expect it to work.
You could however write your backend in PHP and use XMLHTTP calls (in JavaScript) to retrieve data and present it to the user.
Additionally you can use any JavaScript framework in combination with Cordova so if you are familiar with any of them (like jQuery, Knockout or Angular) that would be an advantage. I'd suggest starting with a Cordova tutorial, like for example this one: https://ccoenraets.github.io/cordova-tutorial/index.html
Another project that is getting alot of attention lately is the Ionic project, which is also based on Cordova. I'd think based on your requirements this would be a great framework to use: http://ionicframework.com/

Is it possible to edit Google Drive's spreadsheet using some HTTP API?

Is it really possible to directly edit content of a spreadsheet that is located on some Google Drive account from, lets say PHP application?
Is there an API available with granular operations or do I need to download/edit/upload the whole document every time?
Is it also possible to call my script via HTTP when changes are made to this document by user?
Is there any examples of such functionality in PHP or similar technology?

Which protocol to use for this application?

I want to code an Android client and a Windows.exe server application (possibly PHP., I am still trying to decide).
I have no problem with developing the server app, but have not yet done any Android coding. Mostly, though, I am unsure about how to communicate between client and server.
A client aapp will login to the server then at regular intervals send its location (GPS coords) to the server which will store the data in a MySql database,
A second Android app will display a historical trail of where the first user has been using Google maps, plus a little more functionality.
Since I am not serving HTML, I am wondering whether to use HTTP GET / POST or a proprietary protocol over TCP/IP. I would like to encrypt it, so SSL seems in order,
Is there any compelling reason to use one or the other of use HTTP GET / POST or a proprietary protocol over TCP/IP?
Would coding my Android app be easier if I used JSON as my data format (or something else?), irrespective of the protocl used to transfer the data?
Hmmm, since much of the data returned as a response to GET by one of the apps will be data used to draw a Google map with a series of points showing travel, could I do the heavy duty processing on the server & return the HTML (or JS) necessary to display it an dhave the app embedd a browser in its UI to display the map? (the UI will also disply more, but maybe I shoudl just make it browser based HTML & JS, rather thn an actual Jav Android app? As you can see, I am confused)
[Update] I want to code both the clients and the server and to host the MySql database. I would prefer no 3rd party frameworks unless they are excedding simply to use and play very well together with Delphi or PHP.
I may recommend you to use Wcf with poco entity that provide you security as you want and create client in android to consume it.here is simple example of using wcf in android-http://fszlin.dymetis.com/post/2010/05/10/Comsuming-WCF-Services-With-Android.aspx
I would strongly recommend the use of the newest Google Play Services with the Google Cloud Messaging... It takes out of you all that work.
Check out, see if you like ;D
Google Cloud Message: http://developer.android.com/google/gcm/index.html
There is also a great video of this year's Google I/O about the maps improvement on Google Play Services:
https://developers.google.com/events/io/sessions/325172829
Are you trying to create App that can be delivered from Google Play Store or a Andriod enable Web application? You Question is confusing in your need. If you are looking to create Andriod Apps then definitely PHP is not going to serve it up. Look for Andriod SDK and create your interface using that, then for Windows Server EXE you can do PHP based API or as suggested by other answers. But for User interface PHP is no. You need to read and understand the different between APP and Web App. or your question is not very clear on topic.

Is there any sample code for developing the Cardscanning(CSSN) using PHP?

I want to develop a module for card scanning using CSSN.They gave the sample code for another languages like C#,Delphi etc.(except PHP).
Is there any sample code for scanning the document using PHP with this CSSN device?Whether we can develop application for this scanner using PHP?
Looking at their website, and based on the fact that they're using ActiveX controls, I get the feeling you'll never get this working on a language that doesn't use Microsoft's runtime. Even if you were able to somehow get it working, I doubt you would get much support from them on it.
I would recommend, instead, writing a program in a language they support that can in turn talk to your PHP application. As the SDK sends events to your intermediate app it can send them on to your PHP program, and the PHP program can send commands to the SDK through the intermediate app.

Categories