Connecting mobile app with back-end algorithm - mongodb

I'm working on a school project. We have an AWS server set up with MongoDB. We created some user DB for account verification purposes and communicate with it using REST API. What we need is for the mobile app to send some data to the server side. Run it with an algorithm, then return back the result in JSON format. I've never done anything similar to this, so I have no idea how to go about it. If anyone could provide some lead or guidance/links that would be amazing. Thank you.

First of all you dont need a algorithm for it. It is just a process you have to follow and its kinda lot more easy than you thinking.
If you are doing it in android you can connect to rest webservice via Google's Volley http://developer.android.com/training/volley/index.html.
Or You can use Retrofit 2.0. I have been using it for a long time and i prefer it.
http://square.github.io/retrofit/

Related

How to Send data to iPhone/Android from C# Web Service

I am trying to develop a cross platform app that uses a C# WCF web service. I have searched the web extensively but can't find anyone who has asked this question or posted a "how to" for this type of work flow.
For purposes of the question, let's focus on iPhone <--> Web Service interactions.
My app needs to do the following workflow:
iPhone#1 sends data to web service.
Web service pulls data from iPhone#2.
Web service does some calculations based on data from iPhone#1 and iPhone#2.
Web service sends results to iPhone#1 and iPhone#2.
iPhone#1 and iPhone#2 display results to users.
Steps 1, 3, and 5 are easy but how can I perform #2 and #4 above (requesting data from phone and sending data to phone)?
I don't necessarily need code samples, just a push in the right direction. Any help is much appreciated.
Thanks,
JVC
I was able to figure this out a while back and figured I would mention the solution in case anyone else runs across this.
In the most general sense, situations like this require the use of push notifications since they can be used to display a push notification on the device, or to send data packages to the phone for use in the app.
I ended up using Google's Cloud Messaging Service. It was very easy to implement and works like a champ.
Here is a link to the site with all of the proper documentation and guides: https://developers.google.com/cloud-messaging/

Using Local storage and REST adapter at the same time?

I'm pretty new with an Ember so for the start I have a noob question - is it possible to use Local Storage and REST adapter at the same time?
For example, if I want to do a login via API, if login is success the server will return an API key which is used for later communication with a service. Is it possible to store that information locally on the client and to retrieve it when necessary but also, for other models, to use REST adapter?
If this is not a good way to handle such case, which one would you propose and is there any kind of example which would me lead me in the right direction?
Thanks to the people from #emberjs, I found out that there is a wonderful ember-auth authentication framework for the Ember.js which does what I need.

Generating Dynamically OpenTok Session ID from iOS

I am using OpenTokSDK for iPhone (using it Natively)
I have made the code for calling but just there is one problem.:-
I have to statically Add the SessionID. But i want to generate the ID Dynamically.
How can I do this ?
Please help!
Thanks In Advance
Full disclosure: I am a developer for TokBox.
The only safe way to get session ID and token credentials to the device is by developing an application server that suits the specific needs of your app. We have a number of server-side SDKs available on GitHub (link) that will interface with the OpenTok server API to generate this data.
Note well the server-side SDK is enough to get your credentials generated, but not all devices will be on the same session, so things like user management and application workflows are all considerations that cannot be easily written to an open source library.
That said, we did try to make some of these examples more clear by writing code examples on our blog (link). You can relieve much of the overhead of writing your own application server (no doubt a daunting task, especially the first time around) by leveraging one of the third party signaling services available, like Parse and Pusher, to name two.
Wobbals is correct, and In addition to what Wabbals has mentioned, generating sessions/tokens is very simple, the sample code required for each server language (PHP, NodeJS, C#, Ruby) is located in OpenTok's Github page.
Furthermore, if you choose not to have server side code and use Parse to handle your back-end, there is a wonderful writeup about how to use Parse's cloud code module for OpenTok to generate sessions and tokens.
Good Luck!
I strongly felt that the tokbox tutorial was quite basic but had steeper learning curve. So I ended up wrote out my own app-cum-tutorial.
Though late, I felt compelled to post here:
How To write your first iPhone Video Chat App using parse and opentok(tokbox)

Writing authentication system

I am currently writing the backend for a service which has 3 clients: browser, android native and iphone native. I am having a little trouble with coming up with an authentication system since I don't know what can really be done on the clients.
I am using django + twisted for the backend.
Basically, I am going to be writing RestfulAPIs to open up for the clients on both phones to call.
Now the real question is, how should I come up with an authentication system?
I have thought about using sessionids, this works very well with the browser and I can use django's integrated app for that.
However, I don't know if it's possible for both the iphone and android to obtain a unique sessionid on the handset. Should I write an API call to distribute unique sessionids?
if that's the case, is it possible for me to still use django's authentication system since a lot of the stuff here are customized? ( I am not even using a rdbms - I am sticking with mongodb, so I was on the verge of dropping django's authentication app ftm).
I have looked at foursquare's API and their basic auth method requires you to pass in user:password in every http request header. That adds 1 additional authentication each call which can kind of seem excessive.
Please provide any kind of advise that you could give.
You might look at digitally signed RESTful requests, such as what is done with Amazon S3.

How to connect to a Remote Database from native Iphone app

I want to connect to a remote database(MySQL or SQL Server or Oracle) via internet from my native iphone app. I can't find any API or Framework in System to add. does any one know how to connect to a remote Database? pleased help me. Thank you very much
I'm not an iPhone programmer, but I would suspect you want some abstraction going on.
Instead of trying to make a native database connection work, consider writing some service layer that talks to the database on the back-end, and speaks HTTP to your client application.
Plenty of very good reasons for this. Security concerns chief among them.
One way to do it would be to setup an HTTPS server that wraps your requests. Submit your queries via HTTPS POST. The server setup would be pretty basic and it gives you the chance to do any post-processing before sending it over the wire.
The best alternative is to use webservices to access the information stored remotely.
Bye.
Disclaimer : Shamelessly plugging my own product :)
We've built an online system called Kumulos that allows iOS and OSX developers to build and host online databases in the cloud, while easily creating custom API methods for accessing it. It even builds all the Objective-C bindings for you.
Its really really easy to use and its free while in Beta. We'd love some honest developer feedback :)
Check it out here