Own sync adapter for Android? - android

The press release of Android 2.0 states that the new release supports sync adapters so that emails and calendars cannot only be synced with gmail and exchange. However, there is no information available online how to write such a sync adapter. Has anyone tried it and some example code available?

These two articles by Sam Steele (January 23rd, 2010) are about the implementation of the last.fm sync adapter. Do not miss the second part and the opensource projects that are mentioned at the end of the articles.
http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1/
http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/
https://github.com/c99koder/lastfm-android/
https://github.com/c99koder/AndroidSyncProviderDemo

This article, http://ericmiles.wordpress.com/2010/09/22/connecting-the-dots-with-android-syncadapter/, is a great, albeit brief overview of creating a sync adapter and getting it to play nice within the Android framework.

Simple basic explanation by Adam Pullen (last updated May 13, 2011). The article consists of two parts and contains the ShowMyAccountAuthenticator example project.
http://www.finalconcept.com.au/article/view/android-account-manager-step-by-step
http://www.finalconcept.com.au/article/view/android-account-manager-step-by-step-1
http://www.finalconcept.com.au/uploads/files/showmyaccountauthenticator.zip

I'm still learning myself, but this thread should help you understand a little bit.
http://www.mail-archive.com/android-developers#googlegroups.com/msg64769.html

The article of Kyle Miller (March 10, 2012) summarizes how to get started with the SampleSyncAdapter project contained in the SDK samples. He describes how you can add an account for the app in the system settings of your phone. Basically, he explains how the classes AuthenticationService, Authenticator and AuthenticatorActivity are used to handle the server authentication using a token. At the end of the article are some words about authenticator.xml, syncadapter.xml and contacts.xml.

Here is something that I found
Implements a SyncAdapter for Contacts
Not sure if this is what we need to help us roll our own contacts sync service though.

I found this browsable source code of the android exchange sync adapter from the android sources:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.4_r2.1/com/android/exchange/adapter/ContactsSyncAdapter.java?av=f
These where not included, when I manually checked out the android sources at http://source.android.com . Maybe someone can find the appropriate sources of the original google calendar/contact sync adapter? (not just the MS exchange ones)
Here is a german student research paper I found through google:
ftp://ftp.informatik.uni-stuttgart.de/pub/library/medoc.ustuttgart_fi/STUD-2348/STUD-2348.pdf

Related

Is there an API for bbPress?

I'm searching for an API for bbPress.
I've searched here on SO but the posts I'm seeing are quite old.
So is there an api for bbPress. If yes, please how do I access it?
If no, is there anyway I can implement user registration and login via an Android app?
Also, check this repository: https://github.com/buddypress/BP-REST
In general, BuddyPress REST API is in development. Current focus will be on members management and their profile fields.
You can also check https://bpdevel.wordpress.com site, that's a development blog, where Boone is taking care of all the REST things (see latest posts).
User registration and log in can be implemented independently from BuddyPress, using default WordPress endpoints, that were shipped with the latest WordPress 4.7.
All BuddyPress offers for API Documentation is the Codex: https://codex.buddypress.org/
If you want to know if there is a function that does x, then just look in the respective file and that should give you the information for the hooks you need, for example if it’s something to do with activity, then look at bp-activity.php I know this isn't perfect but it should give you what you are looking for. All the function names are very descriptive, so it shouldn’t take more than a few seconds to find a function that fits your needs.
Database classes can be found in these files:
bp-{component name}/bp-{component name}-classes-php
Template functions can be found here:
bp-{component name}/bp-{component name}-templatetags-php
Once you realize how files and functions within files are organized it should be pretty easy to find what you are looking for exactly. Hope this helps!
Alternatively, you could do something like webview around the login/registration page. Not ideal I know but is an option if you don't want to go through the hassle.
There is a bbPress API, which leverages WP JSON API v1.0:
https://github.com/thenbrent/BB-API
But you should consider upgrading it to v2.0 of an API, as it's much better.

Howto integrate static code analysis (SonarCube) into ship.io for mobile projects?

We have a setup where we want to use https://ship.io/ as our cloud-based continuous-integration server.
However we also want to have some kind of static code analysis (preferably SonarCube but that is debatable), which isn't supported officially by ship.io.
The Projects are classic mobile Projects (Android and iOS).
I have seen some posts of people mentioning that they managed to setup this kind of configuration. SonarCube just has released a gradle plugin http://www.sonarsource.com/2015/06/15/sonarqube-gradle-1-0-released/ so the Android part should be doable.
However at the moment i have no idea what would be the best way do do this for the iOS part of the project.
We already contacted the ship.io team on this issue but did not recieve a response yet.
Any suggestions/insights on this?
My name is Tim Rosenblatt and I'm one of the senior engineers here at Ship.io. I'm not sure why you didn't get a reply from our support email, and I'm glad you posted about this here.
As Viktor mentioned, we definitely support custom scripts. You absolutely can run whatever you like during your build process with this type of step.
I've got a few links that should be helpful for you in getting SonarCube added to your Ship job, but you can definitely get in touch with us if anything isn't clear enough for you. You can use the in-app support icon at the bottom right of your dashboard, or just email me personally -- tim at ship dot io
http://support.ship.io/environment/install-software
http://support.ship.io/environment/custom-shell-scripts
Thanks!
You should be able to write a script (bash, ruby, ...) which runs your static code analysis and then call that script on your own Mac or on any CI which supports running custom scripts. AFAIK ship.io does support this, our service (https://bitrise.io/ - CTO here) certainly does.

Android In-app billing - which documentation to follow?

I've just been working through this Android developers guide, but have just found this one also on the Android developer site, which appears to use different classes.
Which is the best one to use? (Neither have dates on, so it's not obvious which is newest.)
My app is for Android version 11+.
Both documents are the same thing - there is no version/time difference.
The first one is an in-depth reference and guide. Skim the first one to understand the general concepts of IAB. Then start reading the second one which is actually a tutorial on how to implement IAB in your app. The second one includes some helper classes which makes your life way easier. If you only want to read the first article and implement all features by yourself you are wasting time!
Note that the second article is actually based on a App Sample that is included in your sdk. Read the app line by line along with the second article you mentioned. You will master it in a day!

Windows Azure Notification Hub for android

There's a very few examples on the web showing how to work with Notification Hub and android. Besides that, it seems that the samples are using a old version of android SDK. I'm trying to use the notification hub with tags (first with android), but I could not find a good resource to learn how to do that. I'm wondering if anyone already did that, and could show me some code.
I'm following this article: http://www.windowsazure.com/en-us/manage/services/notification-hubs/get-started-notification-hubs-android/
but as I said, I would like to notify users according to tags.
I'll appreciate any help.
PS: I'm not a android/java programmer, so a working project will be awesome.
Are you able to run the get started sample that you linked?
Even if they refer to API version 17, it should work the same (you can use Google API 18 without problems).
From the sample code, in order to use tags, simply add your tags in the call:
hub.register(regid, tags); // with tags a list of strings such as ["Yankees", "RedSox"]
Then when you send a notification you have to specify the tag you want to target.
Unfortunately, we do not have the full Breaking news tutorial for Android yet (only Windows and iOS): http://www.windowsazure.com/en-us/manage/services/notification-hubs/breaking-news-dotnet/
The breaking news tutorial does also provide a lot of insights into the things that have to be done for most of tag-based scenarios.

Github service hook for community translation webservice

I am taking care of an open source project: mixare. It's an augmented reality browser released under the GPLv3.
The source code of the project is on github and I would like to hook the localization part to some web-service a-la pootle. If necessary I can install my own instance of a translation service on our server, but also an hosted solution would be fine. So I would like to know:
Is there a preferred translation web service that syncs using github's service hooks? Any best practice to share?
Thanks a lot!
Git integration is one of major reasons why I started to write Weblate. It also supports remote trigger for git pull using URL, so it nicely integrates with Github (you just need to put the URL there).
PS: I've just noticed that Android string resources are not supported by backend I use for loading translations (translate toolkit), so it probably won't work for you...
While I appreciate your wish for git support, shouldn't you primarily be looking for a solution that will give you many and good translations?
To get many translations I'd recommend Translatewiki, unfortunately their manual setup takes some time though.
Apart from Translatewiki, transifex seems to be one of the better and not least bigger (counting translators) services. They've made their own client that take care of importing and merging translations. For gettext translations it can also pull in updated template (pot) files automatically from github, I don't know if that's also possible with Android style translations.
Both Translatewiki and Transifex are 100% free and open source software.
I've been through the same "nothing good out there" phase, so I've started writing my own, as a symfony2 bundle. Maybe it's of use to you: https://github.com/tvogt/translator-bundle
Why? Because I couldn't get weblate or pootle to work, you probably have to be familiar with all the pip and python and ve and whatever stuff. Translatewiki is only for free software. Transifix is commercial.
In 2020, with GitHub Actions (hooks executed on GitHub side), you now have GitLocalize
GitLocalize is a continuous localization tool built for communities and teams that want to simplify their workflow when translating their content.
GitLocalize automatically keeps translations up to date by syncing with your repository.
That won't apply to the OP's project github.com/mixare/mixare, which was moved to GitLab in 2018.
But it can help other projects with a similar need.
You can have a look at Amanuens - it's able to sync with any Git repository, including Github. It's totally free for open-source projects (contact support for details). Disclaimer: it is my company's service.

Categories

Resources