My name is Blake Meike. I’m an Android developer in the Pacific Northwest
I’ve been developing Android for a little over a year now. I picked up your book the other day and I’m really enjoying it. I wanted to ask you a couple questions regarding chapter 13. I’ve started using RESTful ContentProvider pattern recently. It works very well for retrieving data but I’m tripped up a little on how to use it for inserting, updating, deleting data. The other hard problem I’ve found is communicating errors back to the view. Here’s an example for you that I’m currently working on. In this application the user can create a new account from the application. Currently, I’m handling all the communication from the activity because I’m not sure how to communicate error messages back to the activity from a content provider, e.g. if the username is already taken. Should I even try to do this from a content provider? I guess one way around it would be to separate API call to validate account before submitting it to the content provider. Anyway, I wanted to get your thoughts on it.
I haven’t worked the specific use-case you describe, but the general idea is to use the CP a a look-aside cache. You don’t want it to filter your interactions with the network — just to cache recent answers.
I am working through the insert/update issues, right now, for the next edition of Programming Android, that should be out pretty soon. Let me see if I can’t kill two birds with one stone: catch up with the blog a bit, and get some of what I’m discovering up here. Watch this space…
I’m having trouble getting the example code in Chapter 12 of “Programming Android” to compile. I did read the directions on how to set up the project with the “FinchFramework” but I’m new to Android and Java and so I’m completely confused. I need more step-by-step instructions on how to configure the project. The instructions give instructions that assume a higher level of understanding of Eclipse and Java in general. Could you please point me towards a step-by-step instruction set? Screen shots wouldn’t hurt either.
By the way: love the book. I’m learning a ton.
I’m sure you can understand that this book is about Android. We couldn’t possibly expand it to address even most of Java or Eclipse! I can’t guarantee anything, but I’ll contact you off line. If you are bumping up against a specific problem, I might be able to help. … and if you produce a step-by-step instruction set, I’ll totally add it to the repo!
Hello, you posted on github the code of an Oreilly book: Android Programming 2nd Edition. And in the readme you say that for the first edition of the book I should “check out the tag v1.0″. I do not understand. Where exactly is the code? Please, I need the code for a chapter that is only discussed extensivelly in this book (SyncAdapter) – ” Chapter 17: Communication, Identity, Sync, and Social Media”. Actually it is the NetworkUtil class that I cannot find anywhere in the book except refferences to it…
Or maybe (better) if you have the time to explain to me the project you have on the same github: “MiniSync”, I would love to understand how can I adapt it to my case (I have an app using SQLite locally with several tables, a ContentProvider for the DB, and I want to sync the tables with a remote server MySQL)
You would be a life-saver if you could find the time to help me.
There absolutely no tutorial out there for this problem: how to sync Android SQLite (syncAdapter) with a remote MySQL server (using PHP). If I solve this, I intend to write a step by step article about it (with full working code) and I would like to send it to you so you can post it somewhere (I do not have a Blog nor do I intend to have one anytime soon)
There is no article with a full example on how to do it (client and server code). Most of the examples show syncing the Android Contacts table with something unknown… This is old. Not everybody wants to play with the contacts. I have a multi-table ContentProvider for custom SQLite tables, and I want to sync it with a remote MySQL server. Please help 🙂
I can’t wait for your response.
I actually found the NetworkUtil class code. I am trying to descipher it. However it seems that the code in the SyncAdapter example only syncs app data with local Android Contacts table. I really would need a sync between local SQLite contentProvider with a remote MySQL DB with several tables. Still there are no examples of how to do this and I doubt that I am the first who ever wanted to achieve something like this..
Definitely, you are not the first person to want to do this! Have a look at this example code, from my book “Enterprise Android”: https://github.com/wileyenterpriseandroid/Examples/tree/master/syncAdapterContacts . I think it is exactly what you need.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Blog at WordPress.com.