Creating a web service to expose website functionality in drupal - android

I have a website which is already created in Drupal. In one section it consists of a form with different fields which on submit returns you the result from the database.
I want to create an android application to access this search functionality by the form created in Android and also display the results there. Is there a way by which I can write some sort of web service which doesn't change any code for the website and give me desired results.
Can somebody guide me what can I do here? I don't have much knowledge of Drupal but I am familiar with PHP.

You will want to look at using the Services module. Sumit Kataria gave a good presentation on how one would go about developing android/iphone apps using Drupal as a base at DrupalCon Chicago 2011 (there is a video of the session). He covers more then what you are looking for, but does provides a good introduction on how to go about using services.

Related

How can i build native android apps from any website (Not Website convert into apps)

Suppose , i have a website and its running well . Now i want to make an android apps using website information or My apps will contain all the information of that website already contain or how can i connect an android apps with any website.
Some solution :
1. convert website into android apps (i don't need this).
2. JSON API (i think this is best option for me ).
May be there has so many option but this time i can't remember. option is best for me if it is possible . but i don't how to create a JSON API from website .
but i don't know how to do it. please let me know share something for better understand.
or if has any other better solution for this problem please let me know .
You could create a web app, using android native web view or some technologies like ionic, etc..., or create a comprehensive API endpoint in your backend/website and start build an android app from scratch.
creating a web app is a simpler approach but has so many shortcomings in design, functioning and flexibility aspect, so if you want a competitive app with a fine extendibility feature the best option is native android development. but it could be more costly as it needs both backend and android development.
If your website is already implemented and running, you can just create an Application using a https://developer.android.com/reference/android/webkit/WebView. Basically, this is an injected Browser, allowing the user to access your Website without actually open chrome/firefox etc. on the smartphone.
To improve the usability, the layout of your website should be able to dynamically resize the content.
If you wish to actually implement an application (Activities/Fragmets...) you need to connect to your backend server the same way your website is retrieving the information.

Content management system for Android App

I've recently started programming my first android app in eclipse using java and xml and I'm relatively new to both languages.
My App will contain mostly static information for students in university which I plan to simply save as text in the xml itself but the clients wish to have a few pages on the app with content that they will be able to change regularly without having to look at or understand any code.
Basically what I'm looking to do is have a basic content management system that can only be accessed by the client and they can use it easily enough to change the content of those specific pages.
Any help would be great on this thanks!
If the information allows it you could integrate it inside a webview that the clients can update through an web content management system.
You need a web server from where you can send the updated info as push notifications.

How to create a full-featured Android app for a website?

This is my website: http://www.stustu.co.uk..
I want to create an app that can pull down the listings from this website and display the entries in the form I want; enable users to manage their online accounts conveniently within the app; post new entries. Basically, a similar app to Amazon and eBay.
But I've no clue about how to query the information from the website in the app...
The website itself is WordPress based (quite simple, therefore), and my initial thought was to find some API from WordPress. I did find the official WordPress app, which comes with the source code, but it helps little as its code mainly deals with blogging.
So here's my question:
What are the normal ways a web developer would use on the server side to achieve my aim?
Is that achievable for WordPress?
If not, are there workarounds?
I'm a new self-taught developer, sorry that the question is a bit broad.
The most common approach when you're trying to communicate between an app and a website is to use a web service. Popular architectures include using REST or SOAP to communicate with your server.
This video will teach you how to use REST interface properly on your Android application, while in this link you will find that using SOAP has its disadvantages over REST especially on Android(or mobile in general).
I personally recommend using REST APIs with responses in JSON format for your web service. Twitter did the right thing with their own rest api, and you can structure yours similarly.
Other links you will be finding useful as you develop your application:
google-gson
jackson JSON
http://blogs.developerforce.com/developer-relations/2011/02/rest-api-android-awesome.html
Sorry about not answering your question about Wordpress, as I never had the opportunity to use it. For my apology, have this potato.
How much experience do you have with android? If you have none you should go find the getting started tutorials on the developer site and complete a few of them to familiarize your self with the structure of an android application before you attempt something like this.
The next thing to consider is: does your site look and act nicely on mobile? If so do you want your application to simply be a dedicated browser that pulls up your site? Or do you want to create the entire application natively? In the latter case you'll have to build (or find) some sort of APIs that allow you to tie in to the functionality of your site from within the java in the application.
My experience is mostly on Android so I cannot suggest any strategies or examples for how you'd go about setting up your APIs. But I do know if you attempt to build something that sophisticated natively on android with little experience you'll likely get frustrated early.

Android: Creating Formatted Native Android Application that takes Web Content

I'm trying to code a native android application that takes certain parts of a webpage and displays it. Basically I would want a search bar and several other things, so that I can have a clean fitted display on a mobile device. It is the same idea as the Facebook application, I am trying to create a stripped down version of a webpage.
I know how to download a full webpage using a WebView, but how can I take only certain parts of that webpage and display that instead?
EDIT: Is there any way to do this using just java and java-based api's?
(I am writing the application in native JAVA)
Best,
Aneem
It sounds to me like you effectively want to do 'web-scraping'.
I've done this by using an HTTPClient to pull a web-page which I then processed with HTMLCleaner to produce an XML document. I could then drill down through it to extract the various elements I needed (tables mostly).
You'll need to reverse-engineer the web page using the 'view source' capabilities of a web browser.
Be aware though that unless you have total control of the web page source, web-scraping is generally not a great way of producing a stable and extensible app. All it takes is for a re-design of the web page by whoever maintains it and it will potentially break your app completely forcing you to rewrite your HTML processing code.
EDIT: Actually, on the subject of the Facebook app - this isn't the same thing. There are published APIs for accessing Facebook which don't involve accessing the normal Facebook pages. The Facebook app is a 'native' Android app not a web app.
Its not sure from your question if your back-end has web api's implemented via REST, SOAP, whatever. If it does then you'd just use the necessary pieces widgets and all to implement your android application.
If it doesn't then there may not be a direct way to implement what you want. So I'd suggest looking into the back end first before looking at this aspect.
However, you might want to look at PhoneGap if you want to implement a cross platform solution.

Source codes for apps built on Foursquare apis

I've been planning to build an Android application built on Foursquare APIs. I went to the foursquare developer site and tried out the android oauth example. Also I noticed in the showcase several fancy apps such as Instgram, LocalMind. I wonder where (websites like github) I can find their source codes so that I can have a taste of how to develop a real foursquare app.
I am not sure there is a direct answer to your question.. With the exception of code snippets found by google code search or regular google search, do not expect to find full source code for integration with APIs..
As far as oauth goes, there are many examples with a simple google search on how to make it work (note that you have the Venues API that does not requires the oauth process)
As far as source code goes, you should check out this page it should have links to many examples. (got here after two clicks from that page..)
From my experience, we are developing a foursquare-enabled app with a custom server software - in short, our Android app will access our server, which will access foursquare (if required) and get data and pass it to our client (Android/iPhone/whatever).
Bottom line - eventually, you really should learn the API yourself, know the different endpoints and the returned data structures, experiment with different search results and then, if you wonder on what is the right way to get specific data or if you think you are doing something right and getting the wrong data, this is probably the place to ask about it.
The API Explorer should help a lot in doing that.

Categories

Resources