Twilio: making call w/o own server - android

Just begin to learn Twilio API. My intention is to make call directly from Android phone to any landline number. I have read QuickStart guide, build sample Android application and found that to make a call one need to have his own REST server.
I didn't have any experience with any SIP alike apps, but my understanding was that there's SIP provider server through which I could place a call and that's it... (with any kind of authorisation and so on).
So the question: is any possibility to place call using Twilio without my own server? Or as option - could someone advise me 3d party provider of those server which can be used to place call through Twilio?

Twilio developer evangelist here.
Hey, even better then setting up your own server yourself, you can just head to our Github repo and use the click to deploy button. It requires you to have a Heroku account which you can obviously use for free.
From there, you have your own URL for the application, which you can add to your Android App. So no need to setup your own backend if you don't want to.
The repo takes you through all the steps for configuring your app, but by all means if you have any questions, please do not hesitate in getting back to me.
Hope this helps

Related

Twilio Android SDK vs REST API for Chat and Video

I used the Twilio Nodejs and Android SDK quick starter programmable chat and these work great. I am confused by the following statement in the documentation:
The Programmable Chat REST API allows you to control your Chat applications from the server in much the same way you can from the client, except from a service perspective rather than a 1st person one.
Not really sure what this means? Can I develop Android app with out the SDK and use REST API? Why would I do that? SDK seems to be much more flexible and easy to use. Why would you control your app from the server?
What does "except from a service perspective rather than 1st person one" mean?
Twilio developer evangelist here.
If you are building an Android application then I recommend using the Twilio Chat Android SDK.
When the documentation references using the REST API from a service perspective it means that you can use the REST API from the perspective of your application rather than a user of the application. For example, if you need to send a message to your users that appears to come from your application admin you can do so using the REST API. That way you don't need to sign up a user and send messages from it. Alternatively, using the REST API is a good way to send and receive messages as a bot in the your chat system. You can also use the REST API to do system side maintenance on your chat instance (for example, you could close old, unused rooms using the REST API).
I hope this helps or gives you some sort of idea what you can do with the REST API. I still recommend the SDK for your user facing application though.

Twilio - conference call android app

I want to make such an android app in which user can make conference call. user can add twilio user and non twilio ( can call to any phone number ) as well in a same call.
I have seen this , this and also this link .
Which path should i follow or how can i use twilio in my app?
Should i use Rest apis or twilio java sdk or the combination of both ?
Please guide me waiting for your valuable response ?
Thanks in advance.
Twilio developer evangelist here. In this blog post I wrote about the pitfalls of using twilio directly from your device while trying to send SMS messages.
As it happens, the same problem exists while trying make calls. You shouldn't use the REST api directly from the device, but if you're trying to make VOIP calls from it, this example I created should be helpful to you.
In that, I use the Twilio Android SDK to create a new VOIP call from the device. You will still need to authenticate though, but on the blog post I mentioned above I describe how to build a backend to do that.
Hope this helps you

Online Storage Android App

I am to build an android app that needs a central cloud storage (along with some server coding). My app is somewhat in the footsteps of
https://play.google.com/store/apps/details?id=com.justyo
I mean i should be able to store a login and registration (possibly FB login in the future too). Then, i will also have to maintain and fetch users' 'friends' in the app along with a status (that can be changed any time by the friends).
I am not new with android dev. I also know ample amount of web development. However, i don't know the approach to this kind of an app that is to use some server side code and online db for android.
I have search a lot on the internet and have found a bunch of stuff, but i am just not getting the confidence as to which approach is what i need here.
Is there something pre-built and given by Google themselves?
Do i have to by a domain, deploy a hidden (UI-less) web service and access it through the android app?
is there a free option out there by google?
Is there a sample demonstration android app out there?
I don't need the code or anything. I am just confused; afraid of starting off in the wrong direction. Please answer so it is easy to understand.
Thank you in advance :)
There is the Google Cloud Platform, specifically App Engine. You can read the Docs here.
You dont't need to register a domain to use the platform. Yes, you will need to deploy a (not necessary UI-less) web service to the cloud, accessed from the Android client through endpoints. Additionally, the service is free up to certain limits.
Sample apps are available for deployment once you create a project from here.

Understanding aspects of Google Cloud Messaging - basic setup

I have an android application that is designed to receive push notifications via GCM. When I initially designed the application, I used a "deprecated" tutorial (merely because it was one of the most in-depth I found) and my dev phone was running API 2.4, so I was able to get the service up and running without much issue.
Now, my development device is running Android version 4.4.2, so my goal is to "upgrade" my application to handle GCM properly for all devices (for now, lets ignore the fact that I'll have to differentiate how to handle Push Notifications depending on API level).
I attempted to follow the Android Developer tutorial for creating a demo client app for Google Cloud messaging, which can be found here. https://developer.android.com/google/gcm/client.html
While I hate to sound like I want to ignore to smart coding practices, this official walk through was a little big in terms of scope (My application supports Phonegap, and while I think implementing native GCM is much easier than using the PushPlugin for Phonegap, I don't want to handle more than is absolutely necessary in my Java code)
As a last ditch effort, I simply downloaded the demo gcm code from the source they provided here: https://code.google.com/p/gcm/source/browse/samples/?r=1ca8e646c517310e2d46a6a6eda74106b8084fc5
I attempted to import the gcm-demo-client application, and although I know my SENDER_ID, I don't understand anything about the SERVER_URL. The documentation provided by Android Developers talks very generally about HTTP vs. CCS, and I'm struggling to grasp where this server fits into the grand scheme of all that is Google Cloud Messaging.
Assuming I download the gcm-demo-server project directory they included (which seems to be some kind of Java Project), how do I host it? My previous deprecated GCM simply used a basic android application in which I would submit a form containing the device Registration Id, and a message with a title and context. Unfortunately, I can't figure out how to import their demo-server into Eclipse (since Eclipse doesn't think it contains ANY project files), AND I cannot seem to understand how this server connects with my application in any capacity.
TL/DR Summary of questions:
1.) How can I go about "hosting" the gcm-demo-server from URL #2 above?
2.) If I can just copy the Registration Id from my client app to the clipboard, can I just use my "android server" application to send my messages?
3.) Maybe it's just me, but I don't see anything resembling a Receiver class in the gcm-demo-client project directory, only a GcmIntentService. How can there be an intent when the application can't even properly handle messages?!
Thank you for your patience and help!
(P.S. - I cannot provide any code- however since the code in question is merely the provided Android Developer GCM demo code, this hopefully won't be a big issue)
1) There are many companies that offer server hosting services. You should choose one.
2) If you copy the registration Id manually, and hard code it in an application that serves as a "server", you don't need to host a real server, though that would only work in development. In production, assuming you'll have multiple users who install you app, you'll need a real server that receives and stores the registration IDs of all of them.
3) The demo client project you are referring to is old, and relies on a deprecated library (gcm.jar) which contains a default implementation of the BroadcastReceiver, which receives the messages from GCM server and starts the intent service. If you refer to the current demo app, you'll find a BroadcastReceiver class.
The demo app might not work because it is a gradle project and you should preferably open it in Android Studio. That might be why it could not see it as an Android project at all.
I have recently started implementing GCM myself and it is not difficult at all. I am using AppEngine for holding the backend part of my app. In Android studio, there is a very quick and easy way to generate both the android client and the backend part including the cloud endpoints and even a web interface for sending the messages (you don't need to use it though).
I followed this tutorial https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints
Maybe this is not a fully satisfying answer for you, but I found the code very much readable and I understood how this stuff works.

How can i get notifications from server to android device?

I am creating a app wherein user shares some information. This data i am storing it in database through servlets i.e. i am calling my own servlets which will take data through url and store it in database. So i want other users of that same app to get notify that some information is available and in turn they will get the information that other user has updated.
For this to work we can use polling or pusher. But polling will take lots of battery power.
I have tried C2DM but its not working for me. So i am thinking for some other mechanism by which i can implement other than C2DM.
Please suggest some way to work it. and e.g. if u have came across.
C2DM is deprecated, the new version is called Google Cloud Messaging (GCM) and is exactly what you need for your use case. There is even a GCM Demo Application which uses a Java servlet. The source code can be found here, you browse it directly or if you prefer GitHub you can use this repository.
The servlet code can be found in the file
samples/gcm-demo-server/src/com/google/android/gcm/demo/server/HomeServlet.java
If you follow the instructions in the Getting Started guide you will soon have a working application. I would suggest you not trying to copy paste it together, you have to get a clear understanding of how the GCM architecture is working.

Categories

Resources