I want to split up functionality from a bigger SyncAdapter to the corresponding Apps. Therefore i now have a single App which contains the Authenticator and a SyncAdapter which syncs core data.
The plan is now, that other Apps also contain SyncAdapters which sync the app-specific data.
Reading https://www.captechconsulting.com/blogs/android-single-account-multiple-application-prescription i tried to add a second adapter like suggested but i'm having the issue that it doesn't show up in the Account's SyncAdapter list.
UPDATE: just figured out that i used the same contentAuthority in the two SyncAdapter declarations (as i only have a single contentProvider) and of course same account-type which leads to a identical declaration and this could be the problem that my second syncadapter just overrides my first one.
still investigating this theory
as already mentioned in the update - the cause was the identical declaration.
you have to use a different contentAuthority (ContentProvider) for each SyncAdapter to get this working!
Related
One can visualize Encapsulation as the method of putting everything
that is required to do the job, inside a capsule and presenting that
capsule to the user. What it means is that by Encapsulation, all the
necessary data and methods are bind together and all the unnecessary
details are hidden to the normal user
Encapsulation may also refer to a mechanism of restricting the direct access to some components of an object, such that users cannot access state values for all of the variables of a particular object.
Above two extracts i have taken from two different places.
Why they mention word user here?
I believe a user is someone who is using the product.Example. For an android app user is someone who is downloading and using the app..He/she only has access the the product functionality and not the code running behind it.So how is encapsulation hiding unnecessary details from user.Instead it's hiding implementation details inside one class from another using private?
"Users" here means other programmers who are going to use your code/API/library.
This is not an uncommon or unusual choice of words. If you want to refer to the users who are downloading and using the app, people usually use the term "end user".
I am creating an android app that can be used by common users and also admin.
Suppose, if admin adds a new place name, that name should be added to database and when common user uses the app, he should be able to see the place name that is added.
I used MySqlLite database. But the problem is that if the app is uninstalled all data is lost. So I want some persistent data storage in which all the places that are added by admin are saved permanently.
Regards,
Sindhu
With the data being needed across multiple devices, your only option is to create/use a backend API.
Parse would have been a good choice but since that is getting shut down soon then it wouldn't be wise to use that.
Take a look at these alternatives here
You could also write one yourself, but unless you have some experience in that sort of thing then it will take some time to learn.
In creating a mobile application for Android, I am dealing with a SQLite database which requires a ContentProvider. The ContentProvider is used for adding, update, reading, or deleting data from the database.
I read http://developer.android.com/guide/topics/manifest/provider-element.html but I did not find any further information what it means, especially for working with databases.
I have seen some manifests that define the following provider:
<provider
android:name="main.ContentProvider"
android:authorities="main.ContentProvider"
android:multiprocess="true">
</provider>
What does it mean to have multiprocess set to true? Does that mean many database queries will be handled simultaneously? And if I set it to false, what happens then?
Thx.
An Android framework engineer said "Don't use this attribute"
https://groups.google.com/forum/#!topic/android-developers/u9UMJtALSXw
Don't use this, it is some old cruft from pre-1.0 design that doesn't
work and should be ignored these days. Just pretend like the
attribute doesn't exist. :}
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email
to android-d...#googlegroups.com To unsubscribe from this group, send
email to android-developers+unsubscribe#googlegroups.com For more
options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-- Dianne Hackborn Android framework engineer hac...#android.com
Don't use android:multiprocess="true".
Not only does it passively not help you, but it even actively causes other problems. For example, if you have android:multiprocess="true" then android:process=":something" doesn't start in a new process.
I have a messenger app that makes GET /conversations requests to populate a list of the conversations of the user.
The next step is to make it "listen" for updates so that it marks conversations that have been updated and add conversations that have been created.
Should I use the same /conversations resource to get the updates or should I rather have a separate resource for that? Perhaps, something like /conversationUpdates.
It depends on whether you want to follow RESTful conventions. Many client side libraries such as backbone and extjs have fairly deep support for declaring a resource with a URI and then using the different HTTP methods (GET, POST, DELETE, etc.) against it. This might sometimes lessen the work clients need to do and folks will be grateful.
Following the convention will also make your api less surprising. There are undoubtedly other conventions for API's and not every domain space is well modeled with REST.
Rereading your post, I see you want to have an api that that just gets new posts. What constitutes new? New since the last time the client called the end point? In such instances an api might accept a parameter like the last identifier that had been received (if you are using something like a auto increment field, or a mongodb id). In that case you would just use the /conversations endpoint, with an extra parameter.
Firstly, I'd stick here with the GET method, since this is exactly the point: getting data.
As for the resource name, I'd go with the same, specifying it further in the query, something like /conversations?state=new. My point here is that the resource itself is still the same but you only want a subset of it.
However, if you plan on updating other things than conversations, you can use /updates/conversations since in this case, an update can be considered as a resource, itself composed of, among other things, conversations.
I use a service to check for stuff on the server, and wanted to transition that to use the standard android sync capability. However, the config file confuses me.
android:contentAuthority
android:accountType
android:supportsUploading
I don't know what these represent and don't have any meaningful values for them. It seems like I'll need a content provider to use the sync, but that's not how I implemented everything.
Any good links or info on implementing sync with your own code?
You can implement anything you want for your sync needs. Android sync adapter provides a framework for sync'ing which includes states, callbacks, settings, scheduled events, etc. You can use what you need and leave the rest for other apps. There are helper functions that makes it easy to use consistently with the syncing that you find in Accounts & Sync Settings.
The android:contentAuthority is the unique identifier used during the broadcast that your sync adapter would respond to. It is like "com.mycompany.myproject. ...". The flag android:supportsUploading is required for permission to send data out of your application. I believe it is coordinated with some android:uses-permission setting.
I don't think you are required to have a CP, but quite often you would and if you do, it can be really thin to be the authority.