Android shared database development - android

Please give me some light regarding to this situation. I'm new in android development and I don't know how to handle this. I need to have my application to be install in many Android devices at least two device. Now I want both of them to share single database at the same time because there will be data to be process by one another. I'm a full pledge ASP.Net programmer so my mindset regarding this situation is to build a host device then the other one will connect to the same network as where the host is connected or is there any other way how this two can be connected then share the same database.
Thanks in Advance.

Make a REST api and talk to it with all android devices. The server must control the database to make sure that nobody reads or writes the same database rows at the same time.

Related

Distributed app without external server design problem

I am trying to figure out good design for an android app that is ment to communicate with same app on other phones.
Lets assume following scenario, 4 people meet and they want to connect thier phones together to share some messages between them. I have decided to try out following approach: One of them creates a group 3 other people will join. Creating a group essentially will start a server and open a socket. How remaining 3 apps can find out how to connect to the newly created server?
I have considered using bluetooth, but as far as i know it is limited to only a few devices. Manually sending IP addresses to eachother seems to be an option, but thats not what an app should do. External server would be a solution to this problem, but the entire point is to avoid having that.
What would be a possible solutions for apps discovery?

How to access localhost (xampp, phpmyadmin, etc.) from an Android device?

I want to make an application on my android device (raspberry pi), which scans an item barcode, adds it to a list, and then tallies up everything. As I have more experience with Web App Development, I figured I might be able to build the app faster this way. However, my problem is, that I am now considering how I would access the localhost database in order to pull the data linked to the corresponding barcode scanned. Should I just stick with SQLite and build an android app?
Edit: I just noticed that there's something called "PAW Server". Has anyone had any experience with using this?

What is the proper structure for accessing a database on mobile apps?

I'm a complete beginner with mobile development. A friend of mine approached me with a project idea, asking me if it was possible to do it. The way I see it, it is a mobile app that needs to read and write data on a database in order to write inspection reports on the job of various staff members.
I told that friend that I would check how mobile development works first and would try to create a prototype to present. I've asked and Android is the main platform that is desired, so I've tried working with Android Studio and it is pretty straight forward up to now.
So, now I'm wondering what is the proper way to sync mobile apps with the database. Last time I worked with a database in a project we had multiple clients connecting to a server to play some small game together and the server would access the database and send the data back to the client through the network connection. So, I was wondering if a mobile app was supposed to use this communication structure or would simply talk directly to the database instead of a server.
The structure I have in mind:
Is this an acceptable structure? Or am I thinking of this the wrong way?

Connecting iOS, Android, and Rails App to One Database

My friends and I are developing a rails app (ruby), iOS app (swift), and android app (java). We are trying to figure out the best way to connect them all.
From our current research, we are under the impression that an API will need to be created with rails and the mobile apps will then have to communicate with that. Is this the only solution? I am also understand that apps can "pull" data from an api, but what about the other way around? We would like each application to be congruent with each other... for example, a record is created in the iOS app. As soon as this happens, the record should also be able to found on the rails app.
When thinking about it, it seems like all we would need is one database, and then have all of the apps connected to it. Would something like this work?
Having trouble finding solid information regarding this. If you know of any documentation, please pass it my way.
The best way is to host database in cloud and access to that common database from all applications. If you host your database with any hosting provider, they will give you a connection string using which you can access from any application. See Amazon AWS for example.
As I understand it, the popular way to interface with your database would be to expose it through a REST framework. Doing this, it doesn't matter how many apps you want to be able to interact with the data, or what platform they are on.
Also, check out Kivy as an option for your mobile implementation, as it allows you to deploy to iOS and Android from a single code base. Of course, you may need to account for differences in hardware APIs, etc... But that would be easier, IMO, than maintaining multiple code bases.

Communicating between mobile devices over a local network

I'm a complete newbie with regards to developing for Android, and for starters I'm trying to develop a simple card game that can be played multiplayer over a local network. I'm having trouble finding a starting point for how I would go about this, I can find plenty of things for communicating across the internet but not having much luck seeing how you communicate directly between two devices over a LAN.
It's a major part of my plan for this app that it be multi-platform and that iOS devices and Android devices can play against each other, so I'm looking for a method that supports this. I know it's possible as I can see there are other apps that have this functionality.
I don't need a detailed implementation (although the more help the better!) but if anyone could just point me in the right direction for how to go about something like this, I'd be really grateful.
I think u need a connection peer to peer, android implements Wifi Direct
Look android dev site. http://developer.android.com/guide/topics/connectivity/wifip2p.html
For a card game I recommend using client-server.
Electrotank is a good server that provides a framework that helps you create a game of this type, with rooms, chat, friends list and connect to Android and iOS. U can write server plugins in Java.
http://www.electrotank.com/es5.html.
Another good server solution is SmartFox.
Or you can create a turn-based game, creating a database to save data and a counter on each client, where you will limit the time for each move, from this time you send data to the server and your opponent query this data the server.
I was working on the exact same thing. You'll want to use sockets to open up connections between multiple instances the same app.
I created an example app that demonstrates how to do this which I link to and explain in great detail here: http://brendaninnis.ca/connect-nearby-devices-part-2.html
I have an example for both Android and iOS that communicate with each other.

Categories

Resources