Resolve Duplicate Permission Problem in Android Package

Standard

Android application has unique identifier called package name to prevent duplicate installation. The standard convention name for Android package name is reversed web URL.

In development process, developers may need to separate application into some versions for testing purpose. For example, we need beta version to be tested before it’s released on the marketplace. We can separate them using different flavors definition in gradle script.

But it can be problem when we use the package name in the manifest file. So we may need to adjust the manifest too.

For example, if we use GCM (Google Cloud Messaging) to enable push notification we need to add permission with unique name (so it has to be the package name). So for different package name it need different permission or there will be problem with duplicate permission. Here we need to define another permission with specified package name and remove the previous permission definition when merging the manifest.

These are the sample code of different manifest file for different package name in different flavor.
Main AndroidManifest.xml

<permission
android:name="com.packagename.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.packagename.app.permission.C2D_MESSAGE" />

Beta AndroidManifest.xml

<permission
android:name="com.packagename.app.permission.C2D_MESSAGE"
android:protectionLevel="signature"
tools:node="remove" />
<uses-permission
android:name="com.packagename.app.permission.C2D_MESSAGE"
tools:node="remove" />

<permission
android:name=”com.betapackage.app.permission.C2D_MESSAGE”
android:protectionLevel=”signature” />
<uses-permission android:name=”com.betapackage.app.permission.C2D_MESSAGE” />

Culture Test

Standard

A few years ago, Joel Spolsky created a test to measure how good software development team. Many engineers or companies use this test to evaluate quality of software development team or company to work for. Some companies also use this test to assess their own software development quality and determine to-be-improved area.

How about measuring non-technical aspect such as their culture? Continue reading

Golang – The HardWay

Standard

About golang :

Go, also commonly referred to as golang, is a programming language developed at Google[7] in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.[6] It is a statically-typed language with syntax loosely derived from that of C, adding garbage collection, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.

Source: https://en.wikipedia.org/wiki/Go_(programming_language)

I’m starting to use golang language in some of Onebit’s projects.  I have learn this language before, but only for introduction, something like “Hello world”.  This time, I’m learning it deeper, and just as the title said, learning golang is hard. Continue reading