I have already written a backend server application, which executes rather complicated tasks in Kotlin and it is running fine on my local machine.
I looked into Firebase and found out that you could host your website and create your database. My server application is basically a database, plus everything to handle it. I think that it should be possible to write the same database with Firebase's database too, but I think that that would require quite some time and I would need to learn how to access the database from Android and also understand how the Firebase database works and how to implement my functionality.
Concluding
My question basically is, if it is possible to deploy my already written app to Firebase and access it like before. Maybe through the website hosting and a link to my Kotlin app. I could not really find any information on how to do something like this.
TLDR; No, this is not possible with Firebase, however there are alternatives.
Firebase is a Backend as a Service, this means, that they basically provide most functionality for you. The Database can be directly accessed from the client application (an android app for example), or a third party server. The website hosting is static, meaning you can't perform server side code, and instead only serve your pre-built Html/Css/Javascript.
They have recently introduced Cloud functions, which are basically small functions executed on their servers, which could fulfill your purpose, however those are currently only available in javascript, and probably have a vastly different architecture from your existing backend, due to their nature of being small functions.
If you don't want to rewrite everything to work with Firebase, I'd recommend going with a service like Heroku, which is a Platform as a Service. This means that you can deploy your existing Kotlin backend to Heroku, and use that as the backend for your app.
Related
I need to create a Rails app which in the future will need to share the same database with a native app.
As I am still quite inexperienced I would like to understand which way is the best to have the 2 app share the same database, in this case I will use postgresql.
I'm thinking of using postgrest for it but I'm unsure if there are any better/ faster ways.
which way is the best to have the 2 app share the same database
The best way is to not share database at all. Mobile app does NOT talk to database directly. Instead, it should talk to an api server, which will provide needed data and perform appropriate checks (user credentials, etc.)
The API server may be implemented as part of the same rails app or a separate app.
Another way might be to expose a read replica for your database to the mobile which can access the data directly through it via the API calls.
There are lots of options, depending on what you are trying to achieve with the web app. You can look into BAAS's such as Firebase or similar products. However, if you are already using rails, you try the new Rails 5 API mode, where all your controllers and models are preformatted to serve JSON making it slightly easier to get your API up and running for your native app.
An API (to clarify your understanding based on your comments), is a layer that will deal with creating, updating, editing, and deleting things in your database. You will have to define it using your own code (or rails generators if your app is very simple). This layer is so you can insert business logic before the database operation is performed based on the request sent from your app.
The background story: I have a nice client in a form of an android app, and now I want to create a backend that will use the Data Store service of google.
Now, I've created a simple backend module in android studio (SayHi example) which I've tested and works well.
My problem is how to proceed now. all the backend developing itself should happen in Android Studio or another environment? where do I create the backend classes and objects? how do I connect it to the data store service and perform queries?
Main question- how the backend creation process exactly goes, and once I'll connect the dots- where is the information on how to develop it (classes creation etc).
thanks!
You can do your development inside of Android Studio. Just have 2 seperate modules inside the same project; one for the android app and one for the backend.
You've integrated the sayHi example and you've said it works. Have you been able to call it from your app? If so, just look at the example, make sure you understand how it works and expand on it.
For you backend it would be best to use some sort of Service Layer - Business Layer - Data Layer design pattern. The endpoints themselves would be in the Service layer. The business layer will manipulate the inputs and outputs. And the Data Layer would be your connection to GAE. I personally use Objectify in combination with the datastore but you don't have to.
I am an Android Developer and a noob when it comes to web technologies.
I am planning to create an Android app that stores its data to a database.
I do not want to maintain my own server so I guess I would be resorting to Cloud Services.
The thing is I do not know where to start.
What do I need to be able to access and store data to a cloud database from my Android app?
Where can I get a cloud database preferably for free.
Do I need to use web services?
Any help
There are a few things in this that make me ask questions, as opposed to answer them.
Do you mean for your application to be always able to communicate with the database, or will it be more of a backup/sync with a database you have on your handheld.
If you do intended the app to be live all the time, then just write a web app and construct it with small screens in mind. It would be faster and sort of cross platform.
If you intend to have the app just sync with a back-end.. Well then a simple web service should do you for storage. Yep. Rails would be the way to go.
It really depends on your users.. How will they be using the app? Where will they be?
Personally I like the stand alone application that just sync's with the back-end. It is less prone to crashing because I walked into a tunnel. It also lets me control when and where I am when I sync. But it means the data I'm looking at could be out of date. And the data I'm adding isn't right there for others to consume.. they have to wait for me to sync'.
Check out Amazon's AWS and their SDK for Android. Highly recommended.
I assume that you know Java and my solution would be GWT/GAE ,since you asked for web application,GWT https://developers.google.com/web-toolkit/ would be perfect way and also you could use Google AppEngine Store as Cloud service and also you can integrate GWT with Phonegap to run it in Android.
I'm planning on constructing a large application. It will have a browser based interface along with a mobile application interface (iOS, Android, blackberry).
I would like to be able to push data from the server onto these interfaces, and there will be a lot of data being sent from the mobile apps back to the server. So my question is what kind of server am I looking to build.
I'm a PHP developer mainly, though I can write in Java and have dabbled in others. I'm fine with learning a new language. My thoughts as a PHP developer is that I could just build a PHP application and use it's API to power the other interfaces.
However there will be a lot of data moving around and I don't feel like PHP would be the best base for this really. So I'm exploring alternatives. Any thoughts on where to start with this?
you can use a framework like Rhomobile's Rhodes that generates your browser based clients and they also offer a server component: http://rhomobile.com/products/rhosync/
Common practice would be to separate out the backend functionality between different servers.
Server 1: serve up your static content
Server 2: serve up your dynamically generated content (things based on queries that require IO such as DB interaction
Server 3: dedicated realtime infrastructure for the realtime push functionality
Server 1 & 2 could probably be the same server for now but I'd recommend having a dedicated realtime server. Communication between servers is normally done with some sort of message queue although web service calls are also an option.
My area of interest is realtime push so here's a bit more information on that. If you want to stick with PHP there's the phpwebsocket project. If you want to look at Java then there's [WaterSpout}(http://www.spoutserver.com/), jwebsocket and Jetty which has been around for a while and is (or was the last time I checked) used by the Twitter Streaming API.
There are more options for the realtime component of your solution on this Realtime technologies guide which I'm maintaining.
I'm currently developing my first Android application and still in the designing stage trying to come up with a solid model.
My application will use the GCal data from a users Google calendar and sync it up with one or more other users to determine common meeting times between all without the tedious back and forth of scheduling over email.
I vision this working by storing each user and their calendar data in a database that will be refreshed daily. When a query to determine the optimal meeting times between a group is issued, I want to select the calendar data of each user from the database, perform the computation to find optimal times, and display the results back to the user who made the query.
The AWS SDK for Android supports Amazon SimpleDB and S3, in which case I would use SimpleDB for my database. Where I am getting lost is using the Amazon EC2 web service in concert with the SimpleDB to perform the computation.
First off, any feedback on my approach and/or design is appreciated.
Second, how does using non-Android, but Java based APIs/SDKs effect applications, or is it even possible to do so?
The API typica for Java looks interesting and useful if it is possible to use with Android for instance.
Thanks!
So, I think its important to note a couple of things.
What you are describing is not an 'android application'. Its a web service application with an android client. The reason I'm being pedantic is that many of the design decisions you need to make are completely besides the fact that your primary client will run on android.
I'm concerned about the viability of storing the users calendar in a non-relation database. I don't know if you've already looked through this, but the problem you are trying to solve (calendaring) seems like it would benefit from the relational benefits of a relational database. For instance, i'm not sure how you would structure for storage the data of past, present and future events/meetings in a non-relational. Its probably possible, but i'm not sure if its optimal. Depending on the amount of data you may also need to consider the maximum record size.
While its true that AWS SDK for android supports writing to S3 or SimpleDB, I think there is a lot to consider. The reason you are confused about the interaction with EC2 is that normally, your EC2 web service will be interacting with S3 or SimpleDB. By using the AWS SDK you can, in theory, remove the requirement for a web service. My main issue with that is that you're now forced to do lots more on each client because there is no common access pattern. Your ios client or web client needs to have all the same logic that your android client has to make sure its accessing your s3 and simple db data the same. If that doesn't make sense i can elaborate.
Using non-android api's and sdks is a mixed bag. Sometimes it works fine if the classes compile to Davlik. If they don't it doesn't work.
One thing I might point out, since you'll already possibly be tied to a Google technology is Google App Engine. The nice part about it is that there is a free level of service which lets you get your app up and running without cost. Based on the technologies you are suggesting, it might be something for you to look into. Other than that, my other strong suggestion is that you focus on building out the web service first and independently of the android client. Take the time to model what the client server interaction would be and move as much of the 'logic' to the server as is possible. Thats what I felt like was missing from your initial description. Where the crunching would be.
my solution is that you use O-O principles. store your db on amazon dynamoDB and then sync user data with the mobile app. then you do processing of the data/computation on the device before displaying the results