Question

I'm having a little problem trying to figure out how to set up maps on my android app that uses Transfuse framework.

Since I didn't see anything in the examples and documentation regarding maps, I tried to follow this tutorial: http://www.vogella.com/articles/AndroidGoogleMaps/article.html

Unfortunately when I get to add the metadata:

@MetaData(name = "com.google.android.maps.v2.API_KEY", value = "my_key")

I get: error: No resource identifier found for attribute 'resourceSpecification' in package 'android'

Looking at my manifest (that transfuses auto generates) I see it creates that 'resourceSpecification' attribute which I think it should be called just 'resource', but still I did not define any resource so it shouldn't be added, right?

<meta-data t:tag="+,n,s,v" android:name="com.google.android.maps.v2.API_KEY" android:resourceSpecification="" android:value="my_key"/>

I confess I'm a little lost when it comes to "converting" regular manifest set up to the Transfuse way, another example:

<permission
    android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

How would I set this up? (I guess that's topic for another question, but still Map related)

Any help would be appreciated :) thanks!

Was it helpful?

Solution

This was a bug prior to 0.2.3.

In terms of the <permission> and <uses-permission> you should be able to use the @Permission and @UsesPermission annotations on the @TransfuseModule configuration class:

@TransfuseModule
@Permission(name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE", protectionLevel=ProtectionLevel.SIGNATURE)
@UsesPermission({
        "com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE",
        Manifest.permission.INTERNET,
        Manifest.permission.WRITE_EXTERNAL_STORAGE})
public class Module{}

produces the following:

<permission
    android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top