Android app + SOLR - android

I would like to use SOLR to do search on my android app. Is this something that I can do?
If so could you please point me to some code samples out there?
Thanks

Depends. Solr is a quite heavy server application, it's not really suited to run on an Android device.
You'll want to run Solr on a server somewhere and have your Android app connect to Solr via HTTP.
However, Solr is not designed to be used as a public HTTP application (see the Solr security wiki page), so it's generally best to write a small web service that acts as a proxy and at the same time offers a simplified, tailored API for your Android app.

In a particular Android application I know, they use an API endpoint written in
a Python framework which talks JSON. They use both MySQL and Solr for persistence
and some kinds of data is stored exclusively in Solr. And yes, they are using
Solr for it's query capabilities.
Do follow a "Android client <-> API <-> persistence layer" design; dont expose
any databases directly to the android client. As Mauricio Scheffer pointed out,
Solr is not smart enough to secure itself from a delete * from someone who
reverse-engineered your app; a properly designed API can handle illegal requests.

performing a SOLR search on mobile device using this modified class for ANDROID
https://gist.github.com/soltrinox/4b1b85509699c718b5d9

Related

Using Amazon RDS with android application

Background
I have a EC2 instance with a RDS instance(MYSQL) associated with it.
I want to use a android app to execute queries on that MYSQL instance.The Android sdk of amazon does not support RDS.
Problem
How do I connect my android app with RDS instance?Is it possible to use RDS(MYSQL) with an android application without sdk support?
RDS is not a database engine. It's a service that manages the infrastructure for you that's required to maintain a highly available and fault tolerant database. It supports a number of different engines such as MySQL as you mentioned. Please read the docs for more information.
You need to connect to your RDS MySQL instance the same way you would connect to any MySQL database. Using a library that supports MySQL, and using the hostname, username and password for your database.
However, it's probably not the best design to have phone clients connecting to your database remotely. The best thing to do would be to put a REST API on AWS that interfaces with your database.
Having n users connected to your database from each handset using your app is probably a bad idea. It means you need to have more power in your database, greatly hinders your scalability and makes things less secure as the database is exposed to the internet. With an API in front of it, you can build a much more fault tolerant, scalable and solution.
The "cloud way" to build mobile apps is to (within reason) build your application logic on the cloud and simply have your client code connect to your API. This way you can spread to more platforms (eg. IOS, Web) much more easily as you won't have to manage separate application level code for each platform. You'll just need to manage code that integrates with your already existing API.
Take a look at this whitepaper. Ignore the web server tier and focus on the App Server and Database tiers. This is probably the best design to go by.

Server side synch up code for mobile applications

We are planning on developing a cloud service where any mobile application that requires to synchronize data into a server is available out-of-box on a public hosting. This will be done using a NoSQL database and hence any data can be saved easily and only requires a HTTP/JSON communication.
Are there any out-of-box solutions already available in this space which majority of the mobile developers use?
We want to get your opinion on whether this is something that can help mobile developers?
For iOS there is something called RestKit that automatically gets response, parses it and gives you a dynamic object. It works with all kinds of servers and response types. Hope this helps a bit, for server side configuration you can use Apigee which does something similar. I have worked on both so thought it would be useful for you.

Android cassandra client example

I need to update an Android app to talk to a Cassandra database. Can anybody point me to an example or libraries to support this?
Normally, you will not do this directly. You should develop an appropriate API (probably a web service, RESTful or otherwise) or mobile web site. Then, your web service/site will sit between the Android app and Cassandra. You can use the server-side language and framework of your choice.
EDIT: A good approach to try is a RESTFUL API with JAX-RS.

What should I use as a server to meet the following requirements?

I am trying to develop a system that involves a:
server with a database that will handle the system's logic and manipulate data
an android app that will interact with that server (pull and push data into the server)
a website that will do the same as the android app, but from a website with slightly different data.
What I thought of is to use SQLite with Apache Tomcat installed on the server and deploy a Grails war file on it. That will take care of the 'website' side of the system. But what about the android app? Can it communicate with Tomcat as well?
Tomcat will suit your needs. I would look at hosting options though. Are you hosting your own server, or do you have a hosting provider? Do you have experience hosting a tomcat server etc. Do you have experience with java web applications, or other web frameworks? All of the above, and probably more should lead you to your decision on what type of framework/language to use on the server. This in turn will lead you to your options for hosting, and web-container to use.
Once that is determined all major web frameworks will allow you to publish web-services Rest, Soap, etc. that can be consumed by an android application.
Also, if you are planning on providing a web interface and service at the server level, my guess is you are going to be storing a fair amount of data, I would look into a more robust and scalable database such as mysql or postgres. This post contains some insights into this.
If you have an API that is web accessible, an Android can access it.
Android shouldn't have any problems communicating with Tomcat.
Look at http://grails.org/doc/latest/guide/13.%20Web%20Services.html for more information.
A RESTful web service is most likely what you'll need. Android can consume SOAP web services but it requires more work for less overall functionality.

server for android

I need to implement an http server which accepts requests from android devices. To give a brief idea, this server will contain a location based game, and multiple android devices can access this game which is stored on the server. The server will also handle messages sent via mobile devices. can you give me some tips or links of articles/tutorials which might help me in this task?
Any server can make this stuff. It depends on what programming language are you using on server-side. I don't know what language you know but I usually use ruby on rails. If you use rails, then you can use heroku for a quick and fast server to implement. But it depends on your language.
I wouldn't use HTTP as a game server protocol.
Take a look at Apache Mina. It's an Java, event based framework. I recommend the "new line" protocol.

Categories

Resources