Using SlimPHP in a hosting environment - android

I am building a series of Android Apps that will be used by hotels to help with their operation. The backend for the apps to access the database is written using the SlimPHP microframework. Once I get the system is complete, my customers will be assigned a database for their information. I need a way of configuring Slim to use the assigned database name. The way I have it planned is when the customer signs up for an account with me, I will have a script that will create an account for the customer to include a database. The database with be identical from customer to customer. I just need a way to set SlimPHP to use the correct database. I was thinking of have the database name saved in android, and have that name sent to Slim from the app with each request. I am not sure how/if Slim can do it. Is it possible, or will I need to create my own API from PHP for my apps? If I need to provide more information, please let me know. Thanks for any help. Troy.

Related

Android application to store and access data on/from a local server

There is already a portal system which is based on the web, and allows the teachers to enter the attendance data. But it takes extra efforts from teachers to write it once on paper and then to update the data on the server.
I am developing an Android application. This app facilitates the teachers to take attendance of students on mobile itself, then upload it to the server, hence reducing the use of pen and paper. Firstly it asks the user to sign in, then it displays the options of various semesters + sections + subjects which are fetched from the central server.
Now, I know how to make the application, I know MySQL.
I want to know what kind of structure is required to make such an
app
How do I connect my app to the local server ?
Is it necessary to use some web based data storage ?
Because I have not enough repotation to comment. I would advice you to use the retrofit libary. It makes rest communication easier. You can include it with gradle and it has many tutorials available.
you will have to use sqLite for local data base in android. you can refer official tutorial for examples
It is not required to use web based data storage as long as you are fine with data being in device itself.

How to store the content for android application

I'm a complete newbie in android development with some basic programming knowledge. Right now, I want to develop an E-Commerce app which allows the user to upload pictures for the public to browse through. However, I have no idea how should I store all the data, including the details(username and password) of the user, in the server. As far as I know, the database most often used in android is SQLite, but I'm not sure whether it's suitable to be used in my case.
Please shed some light. Any form of help would be much appreciated. Thanks in advance.
You could set-up a backend using some database (eg. MySQL) and some programming language (eg. PHP) as well as some kind of web-server (eg. Apache).
You would store the products,user data in tables of the database. Pictures would be stored on some directory on your server and you could store references to their path in the respective fields.
Your client (android) would load the products list as well as submit new products via issuing requests to your server back end, and perhaps store them in some SQLite database if you need the old items viewed to remain viewable without an internet connection.
A few tutorials to get you started:
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
http://www.tutorialspoint.com/android/android_php_mysql.htm
If you'll create an e-commerce mobile app, it cannot exists as a mobile app alone because it needs to connect to other users. You need to integrate it to a web service or a cloud service to tasks such as getting the item data, images, and other tasks involved. There are Baas (cloud) that you can use such as Parse and Kinvey.

Secure Android to Online Database connection

I am working on an Android project where I will have to edit (only decrement) data from an online database. I want to stop anybody from changing the values by themselves. It should be possible only through the Programming.
In short my online database would contain the Balance of a particular account.
While using some of my services in my app, the balance will get deducted.
App should only be able to deduct the value. I dont want any hacker to study my code and be able to increment the balance by any mean.
Is there any possible mean to add security to database. The database should be very secure.
If you want security over network, Do it using existing and well implemented secure protocol, e.g. TLS/SSL. openssl is one good implementation: http://www.openssl.org/
If you even want data to be secure on the server, even the root cannot access it, check this: http://css.csail.mit.edu/cryptdb/

Authenticating MVC users from Android

I just created my first MVC webapp and noticed that I need to store my users in the ASP Schema tables now. I also have an Android app that must authenticate using the same list of users.
Before MVC, I was able to simply post something to a webform and have it check the list of usernames and password for a match (encrypted of course), then the form would return the requested info. How would I do this using MVC?
Otherwise, could I just change MVC's authentication to use my own user tables?
You don't need to store your user details in default ASP schema tables. You can create custom membership provider or you can do it without custom membership provider as well.
You can still POST to your controller action the same information and continue to execute the same logic you were using.

approach for synching android app database with server db?

I'm developing an Android app as a "proof of concept" for our company. If they like it and think it's worth investing, then we'll move on to bigger things. I'm trying to figure out the best/most practical approach for this.....the basics of the app will connect to our DB and display information regarding a specific customer. For now, let's say we will only pull data from 3-4 tables (but there could be 10+ in the future). If the app doesn't have an internet connection then it should use the local DB. What is the best approach for this? Here's what I was thinking and would like some input/suggestions if possible:
1.) app runs checks internet connection. If exists, check db version (how, through a web service?)..if server db is newer, get latest data. If no internet, use local db.
2.) app parses data and displays it.
If this is correct, then there could be no modifications to the web service that would add fields to a result without changing the app as well. Is there a way for an app to parse fields regardless of how many fields there are?
I've read and walked through the tutorial on google with databases and such (Notepad tutorial) but it seems like the column names are all hard-coded in the parsing class, which I was hoping to avoid.
Sorry if this is confusing but I know I need my app to use a local db to read data, I also know that the app must get data from the server when it can (via onCreate or a refresh button) and copy it locally....Copying it locally is the part I'm having trouble understanding I guess....is there no way of saying "go out and get this result and display it", knowing that those results could mean 5 fields the first time or 1 the next.
Any help/guidance is greatly appreciated!
You probably want to use a SQLLite DB to store your data locally, a ContentProvider to provide CRUD access to the db, and a SyncAdapter to sync with your server when possible. The Sync Adapter also writes to the DB via the ContentProvider. See the SampleSyncAdapter sample in the SDK for an example of how this works. You will be implementing your own ContentProvider, but the sample just uses Android's supplied Contacts ContentProvider.
http://developer.android.com/resources/samples/SampleSyncAdapter/index.html

Categories

Resources