Dear all,
I am writing an android app currently and I am a newbie in web app.
I need to connect the android app that I write to a drupal site and get some data or submit data to it with the app.
I tried just using the xml-rpc server and try to connect to it with the android app but no luck yet.
For some reason, the app keep getting the output "invalid api key" which is actually not true. I know it must be some coding problem in my android app but I don't know what it is.
Then I search and find the "Drucloud" code in the beerCloud project and test it. It use JSON Server and Services module.
It connect to its demo side and get back some data successfully. However when I input the api key and domain and server of my drupal site. It returns these result:
{ "#error": true, "#data": "Method \x3cem\x3e\x3c/em\x3e does not exist" }
I also noticed that after I installed the JSON Server module. Drupal display this error message on the page:
warning: Invalid argument supplied for foreach() in C:\eclipse-jee-galileo-win32\drupal-6.15\modules\json_server\json_server.module on line 28.
I am not sure what is the problem and have no idea how to fix it. I almost give up now. Could anyone give me some help? Thanks a lot!!!
Comments
If you're Android / Drupal
If you're Android / Drupal client is general in nature, for example an admin client, I'd love to help in the development. I'm also looking for good cases to develop an Android app and a mixture with Drupal web service calls all the better. If you happen to start a project here at drupal.org, please post back project name and some of your plans.
DRUPAL to iPhone
I am doing the same thing with iPhones. Not a high priority, but I want to come up with some ideas and strategies on how to do it.
for reading data ( drupal to iPhone) I was planning on using http://drupal.org/project/views_datasource.
but I have been planning on doing a straight SERViCES type of solution.
so I will be following along.
Problem solved. Now I can
Problem solved.
Now I can connect it.. The invalid apikey problem is due to the incorrect timestamp. I must use the android function to get time instead of the java function.
Which problem did you solve?
I'm still having the same issues described above...
I see the "warning: Invalid argument supplied for foreach() in D:\My Documents\Programming\Design\Projects\Web\xampplite\htdocs\drupal-6.6\sites\all\modules\services\servers\json_server\json_server.module on line 28." described above
I get { "#error": true, "#data": "Method \x3cem\x3e\x3c/em\x3e does not exist" }
Can you elaborate on the fix?
Please consider use this
Please consider use this library on Android for Drupal+Services http://code.google.com/p/drupalcloud/
See Case Study http://drupal.org/node/659772
This looks really cool
Unfortunately, due to the above issue I can't really get this going because my JSON server doesn't seem to be functioning properly as described above.
FYI... I'm using services-6.x-2.0-beta1 with json_server-6.x-1.
I use the xml-rpc client for
I use the xml-rpc client for android and follow the java example in the services handbook.
The issue was the invalid api key
The problem was I use the wrong function to get the time stamp, you cannot use the java function to get time , need to use the android functions.
I still cannot use the json server tough.
the xml-rpc android is
the xml-rpc android is located here: http://code.google.com/p/android-xmlrpc/
What about JSON
Can anyone advise about setting up JSON Server to interact with Android? Actually, this doesn't even seem to be an android specific issue. It appears that JSON Server is simply not responding properly based on the error I receive (above) when I submit a request.
Drupal Android example via Jason
Hi you can find some info here: http://github.com/gby/droidpal
(thanks to GBY and for royiby to pointing me there)
A small demo movie can be found here: http://www.linnovate.net/android
Drupal Editor for Android
Hi
I created this little tool to create and edit posts on Drupal pages. I wonder if there is anyone interested in helping out with programming, bringing new ideas, maybe some artwork, and so on.
At the moment it uses the Blog API, but I have some wild plans to make it use the Services API. Unfortunately, until now I don't know squat about this API, and don't really have too much time at hand to work on it.
@skyredwang: Thanks for the hint, I'll look into the library.
For new readers it might be useful to now that apparently DrupalCloud moved: http://github.com/skyred/DrupalCloud
Best regards
Chris
I've recently written an
I've recently written an image sharing application for http://tshirtslayer.com , you can check out the nerd site of it here http://dgtlmoon.com/drupal-android-xmlrpc-application
http://dgtlmoon.com
that's awesome! That's what I
that's awesome! That's what I wanted to do too... a simple way to add a node with an image shared from my android phone. Also found this for drupal 7 http://realize.be/mobile
please tell me how to connect Drupal with Android step's
Hi i am trying to connect Android and drupal but i am not getting the correct way to do that .
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
please tell me how to connect Drupal with Android step's
Hi i am trying to connect Android and drupal but i am not getting the correct way to do that .
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
use the services module in
use the services module in order to take the data from the drupal. and use json server. Below code is old and uses the services 6.x module. May be this will helpu out
public class WebServiceCall {
HttpURLConnection conn;
OutputStreamWriter wr;
BufferedReader rd;
JSONObject obj;
boolean threadSucceeded = false;
int count=0;
/
* Constructor of the WebServiceCall.
* @param String data
* The data which will be passed to the web service via POST method
* @author Vivek
*/
public WebServiceCall(String data) {
// TODO Auto-generated constructor stub
WSCall(data);
//System.out.print(WSCall(data));
}
/
* Calls the web service
* @param String data
* The data which will be passed to the web service via POST method
* @author Vivek
*/
public void WSCall(String data){
try{
//Resources res = get
String url = "http://localhost/drupal-6.6/?q=services/json";
String line,response;
//HttpURLConnection is created
conn=(HttpURLConnection)(new URL(url)).openConnection();
conn.setDoOutput(true);
//Sets the connection timeout of 8sec
conn.setConnectTimeout(8000);
wr=new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
rd=new BufferedReader(new InputStreamReader(conn.getInputStream()));
response = "";
line = "";
//Read the response from the server
while((line=rd.readLine())!=null)
{
response=response+line;
}
wr.close();
rd.close();
obj = new JSONObject(response);
System.out.println("--" + obj.get("#error") + "---");
if(obj.get("#error").toString().equalsIgnoreCase("false"))
{
threadSucceeded = true;
}
}catch(JSONException e)
{
//org.json.JSONException: End of input at character 0 of
// If the function is called again it works
count++;
if(count<=1)
WSCall(data);
}
catch(Exception e)
{
e.printStackTrace();
}
finally{
rd = null;
wr = null;
}
}
/
* Returns the JSONObject of the response
* @return JSONObject
* @author Vivek
*/
public JSONObject getExecutionResponse()
{
return obj;
}
/
* Returns if the web service call is successful or not
* @return boolean
* @author Vivek
*/
public boolean isThreadSucceeded()
{
return threadSucceeded;
}
}
formatting is getting distorted :(
Cheers,
Vivek.
saurabh.vivek75@gmail.com || +91 9769934465
Please consider the environment before printing this email.
thankyou to answer for my query
is this path , where i need to modify Administration » Structure » Services
is this implies for Drupal 7 .
1)i am using phonegap so i installed phonegap,and services also in drupal site .
using this link http://drupal.org/project/phonegap
i have did with the project in android mobile stored WWW folder created for the Project that is getting executed but that don't geting connected with the drupal site .should i need to modify some thing in .js coding . PLEASE LET ME KNOW FRI.
2) there is DrupalGap but i dint find any module to save in drupal site to enable .
http://drupal.org/sandbox/signalpoint/1414540
but there is drupalgap folder
again there is a problem
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
Drupal services + phonegap
Hi
I am developing an app using phonegap with drupal services(Rest) i think it is easy and standard method I have also checked drupal phonegap module but i think it is not good approach.
Aim to connect HTML5 + phonegap+android mobile+ drupal
HI Fri,
i have tried to change the url in coding as in drupalgap as in the following as localhost/drupal_sitename.com and whicle executing the code i in android emulator gave 10.0.2.2/druapl_sitename.com , is it necessary to start with "http" http://10.0.2.2/druapl_sitename.com it show URL setting error ( what to do .
any one can tell me to created the app newly as we want to run in our system and see.
what are the coding required once is html and java script or json .
please help us our dead line is for a week ( only
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
Do you know any thing to connect drupal site with android app
let me know if aney thing u find to connect drupal site with android mobile .
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
First try in browser
Please first you try in emultator browser and check your site url is working fine then try in app. e.g http://10.0.2.2/druapl_sitename.com open in browser
I want througe Drupalgap App
Dear Fri,
from emulator if i go through Browser and give it e.g http://10.0.2.2/druapl_sitename.com it's connecting,but what a great deal .
I want it through Drupalgap APP. where up date process is happening that app https://github.com/signalpoint/DrupalGap
if you try phonegap on android this what i am trying to do and got the app in emulater but it's not connecting .from app to the site
inside the coding i try to change the url and gave my Drupal site running in my machine url:" localhost/drupal_site.com"
but still not connecting
Ref:
create a project in phone gap
http://phonegap.com/start#android
drupalgap-project app
http://code.google.com/p/drupal-phonegap/downloads/list
To download drupalgap-phonegap:
https://github.com/signalpoint/DrupalGap
Download JQuery 1.6.4 & JQuery Mobile 1.0 to PhoneGap's assets/www directory
a. http://code.jquery.com/jquery-1.6.4.min.js
b. http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js
c. http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css
where as in drupalgap:https://github.com/signalpoint/DrupalGap
but in this folder
indux.html nothing there inside body should be include any thing over there .
inside : drupalgap/app/default.setings.js & README is empty files ,space 0 KB
while executing in Emulator i could only see the blank page.
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd
want to contact over phone
i am also a new devloper
same project to me
android app with drupal integration
want to contact to u
waiting for ur reply..
How can i help u
Dear Karan ,
you can mail me to himamurthy11@yahoo.com i will send u through mail
plz tel me know. what do u want to know about this project.
With Regard
Hima.J
Web Developer
CompIndia Pvt Ltd