开发者

Android middleware for login and calculations

I want to build an application where the user will have to login before using it...All the data will be stored in an SQLi database but instead of having the application talking directly to the database I want it to send the data to a middleware which will deal with the login and all the开发者_Go百科 calculations that i will later need..

What would be the best/easiest way of implementing something like that?

I was thinking that a php application could do it but not sure if its the best way...

I am familiar with php, java servlets and jsp...Not sure on how to get android to work with them though...

Any help would be really appreciated...


You're barking up the right tree - you wouldn't normally want any client making calls directly to a database (whether it's a backend or local DB the same issues apply). Instead it's a better approach to simply create an object that represents whatever types of persistence logic you would want, but keep the exposed API nice an generic for your clients. This allows you to swap out actual DB instances (Oracle, for DB2, for SqlServer, for XXX, etc., etc., etc.) but not affect the client logic.

Check out the ContentResolver for an example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜