I am building an app using Ola API. I am new to android development and have never used any external API. Can someone please show how to connect with Ola API and do some basic functions in android that are provided by Ola API like -
Login the user
Book the cab
Cancel the cab
Logout the user
I refereed Ola API (https://developers.olacabs.com/docs) but it seems confusing for a beginner please help.
Some code examples would be better. Thank you.
OLA API uses JSON so I think you should use Retrofit A type-safe HTTP client for Android and Java.
as it considered the best library for handling REST APIs.
to get start with Retrofit see this and this
Related
I am new in programming. And I would like to ask what is the step to connect Laravel API. Let say I want to build an Android App and I want to connect to the backend that is Laravel but the point is, the backend is not created by me it is created by other developer and I'm totally don't understand in PHP.
So in this situation, what is the step or how to do Android connect with the Laravel?
PS: I have already saw some sample from other article, but the tutorial mostly are build the both Laravel and Android at the same time. So that is quite not same with my situation...
So Hope I can find out the answer from here. Thanks in advance
You can use Retrofit for creating calling API service in your android application.
This is a very good tutorial: https://www.journaldev.com/13639/retrofit-android-example-tutorial.
For Laravel API, you can follow tutorial: https://www.toptal.com/laravel/restful-laravel-api-tutorial.
The very first step to interacting with a remote REST API is to have an understanding of what the expected request and response data is. This can typically be found in the documentation of the REST API you're trying to access. In this case, since it has been created by another developer, you should ask them for the docs.
After you've gotten a decent understanding of the API, you can use one of several HTTP client libraries for Android such as Retrofit to send requests and receive responses from the API.
Note: It is not necessary to understand the API's code, only the REST endpoints and the request/response schema. A good example of API documentation can be found here
I have been using the Eddystone platform for a few months now, and things are working well. However, when registering new beacons, I am finding myself needing to open Google's OAuth 2.0 Playground and all the steps associated with it in order to send a PUT request that contains my new base64-encoded Eddystone-UID.
Is there any way to register beacons with Eddystone without having to use the OAuth 2.0 Playground? I would like to build a standalone desktop Java application that automates this process, so any Java tips would be much appreciated.
Thanks!
Yes, you can use Google's APIs to do an OAuth 2.0 sign in and then make the web service calls to the Proximity Beacon API. The key part is setting up OAuth 2.0 on your Java client. These two documents might help:
Using OAuth 2.0 to Access Google APIs
API Client Library for Java
Once you have an OAuth token, you can call the APIs as described below. You may have already done this if you are using the playground.
Getting Started with the Proximity Beacon API
Proximity Beacon API Overview
I am currently using Bitrix24 for HR management and task management.
Since it provides an option to integrate third party applications with it, I am stuck in how to implement OAuth for my application with Bitrix.
I went through documentation provided by Bitrix24 but it uses php code.
Is there any sample JAVA code available for OAuth implementation?
Unfortunately havent seen any examples on other that PHP languages, but
if you are already experienced with Java it should not be a problem.
In case you are working with bitrix24 cloud edition - you need to
1) create application for marketplace using you partner account and obtain secret key and application id
2) send this secret key and application id from your application written on any language and receive
3) receive request token and refresh_token and use them to access rest api provided by Bitrix24 https://training.bitrix24.com/rest_help/
more details on what kind of request you need to do: https://training.bitrix24.com/rest_help/oauth/examles.php
hope this help you.
You can use API like this for JAVA
I am adding LEADS from the API, and updating the same LEAD
to add the LEAD:-
Method: POST
URL:-
https://.bitrix24.com/rest/crm.lead.add
Parameters:-
{"fields[TITLE]":"LEAD_TITLE","auth":"AUTH_TOKEN"}
It will add the new LEAD in you Bitrix Dashboard.
I am checking out the google talk api's and it uses XMPP.
Here http://code.google.com/appengine/docs/java/xmpp/overview.html#Sending_Chat_Messages
I am reading on integrating it into my android app. Does anyone know of any good tutorials on using Google talk API with android?
Also does it require app-engine to be integrated?
All you need is XMPP on Android. You can then use GTalk as any other XMPP Server, but make sure to specify the full JID (e.g. "user#gmail.com") as login name.
Can anybody have demo code to get user data (like Username,last name) from his facebook account in to the java code? I have gone thru the sample API but it will help me to reduce my work if I can use some reusable code.
Thank you
hp
Facebook Java API Google Group:
http://code.google.com/p/facebook-java-api/
Examples of the FB Java API (including what you're looking for):
http://code.google.com/p/facebook-java-api/wiki/Examples
One suggestion I have would be to use Google Web Toolkit and/or the Apache HTTP Client.
GWT: http://code.google.com/webtoolkit/ Let's you write complex web-app code in Java, and automatically ports it to Javascript for you. No servlets required.
Apache HTTP Client: http://hc.apache.org/httpcomponents-client-ga/ Provides helper methods for things such as AJAX calls, sending/receiving data, passing cookies/parameters with requests, etc.
Just have a look at Facebook's API, and mess around with either of these tools. Also, have a look at these official Facebook resources:
Facebook API Sandbox: https://developers.facebook.com/tools/console/
Facebook Developer App: https://www.facebook.com/developers/
Sample Apps: https://developers.facebook.com/docs/samples/
Note that the facebook-java-api project is now dead.
Use instead:
http://restfb.com/