Android Question ADM - Manifest Issue

cooperlegend

Active Member
Licensed User
Longtime User
OK, so thanks to DomManfred for creating this new library for us.

I have the demo version working on my Fire devices nicely. But when I put the code into my main project I am getting an issue.

It fails on adm.checkManifestAuthoredProperly
Message says "Must have an API Key"

Yet I have created my new API key and put this in the File folder and attached to the project.

Do I need to change the sample project manifest entries ?

B4X:
CreateResourceFromFile(Macro, ADM.ADM)
CreateResource(values, strings.xml,
<resources>
    <string name="app_name">ADMMessenger</string>
    <string name="menu_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
    <string name="json_data_msg_key">message</string>
    <string name="json_data_time_key">timeStamp</string>
    <string name="json_data_consolidation_key">collapse_key</string>
    <string name="intent_msg_action">com.amazon.sample.admmessenger.ON_MESSAGE</string>
    <string name="intent_msg_category">com.amazon.sample.admmessenger.MSG_CATEGORY</string>
    <string name="server_address">http://webhook.basic4android.de/</string>
    <string name="server_port">80</string>
</resources>

)

Such as app_name and server_address ?

Do I need the server_address at all ? as I don't wish to record the tokens on my server currently....

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Such as app_name and server_address ?
you can ignore it for now. the settings are not really used. You can also leave the values empty for now.

See my code in the example to upload the token to your server.. That´s the interesting part you need to adapt.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
CreateResource(values, strings.xml, <resources> <string name="app_name">ADMMessenger</string> <string name="menu_settings">Settings</string> <string name="title_activity_main">MainActivity</string> <string name="json_data_msg_key">message</string> <string name="json_data_time_key">timeStamp</string> <string name="json_data_consolidation_key">collapse_key</string> <string name="intent_msg_action">com.amazon.sample.admmessenger.ON_MESSAGE</string> <string name="intent_msg_category">com.amazon.sample.admmessenger.MSG_CATEGORY</string> <string name="server_address">http://webhook.basic4android.de/</string> <string name="server_port">80</string> </resources> )
you can also try to just remove it completely. If the app does not Crash then it´s not really used.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Ah, ok,is that just whilst in debug?
I don´t know. Guess no. It will organize the assets in a way other apps have their assets. ADM expect the file to be there.

B4A is using a virtual Assets. They are maybe not compatible with ADM.

So the line must be added when using ADM.
I was not sure about. I´ll add a note to the library thread about it.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Just for the record there is an option to put the file in a referenced AAR file (in its assets folder). It can be an empty AAR that is just used for this.
I´ll try out this later today. Sounds promising (A) and it would make the project faster to compile in B4A (B) :)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Did you added the
B4X:
#DebuggerForceStandardAssets: true
to your main?

Open the ZIP, add your key to the assets folder, rename the zip to ADM-Key.aar and reference this file with
B4X:
#AdditionalJar: ADM-Key.aar

You then should be able to remove the line DebuggerForceStandardAssets and the file in your Files folder too.

I did not tested it (i´m just in my lunchbreak)

PD: Make sure to copy the AAR to your AdditionalLibs folder ;-)
 

Attachments

  • ADM-Key.aar.zip
    303 bytes · Views: 154
Last edited:
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
Confused :)

The aar file is just a folder called assets with the api-key inside ????

OK, tried it :)

Works fine, no idea how or why, but works :)
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The aar file is just a folder called assets with the api-key inside ????
It is a zip file that can include all kinds of resources including assets files. It is relevant here as those assets files are not "virtualized" in debug mode. Unlike regular assets files.

BTW, the virtualization feature was added to allow making layout changes without making full compilation.
 
Upvote 0
Top