Wish class properties for manifest & additionaljar

sorex

Expert
Licensed User
Longtime User
Hello,

I don't know if it is already possible as a search didn't reveal anything but...

wouldn't it make more sense to add manifest blocks and #AdditionalJar declaration inside the class file itself?

Then you (or people using your class) don't need to think about adding the lines to the manifest file and the main activity file.

something in the line of

B4X:
#Region Class Attributes
 AdditionalJar: whatever.aar
#End Region

#Region Manifest Attributes
 AddPermission (android.permission.ACCESS_NETWORK_STATE)
#End Region
 

JohnC

Expert
Licensed User
Longtime User
+1
 

sorex

Expert
Licensed User
Longtime User
If I choose "Compile to library" is that only for the active source panel?

Or for everything?

What happends with the main source code then that is used for testing?
Is that also added?
 

sorex

Expert
Licensed User
Longtime User
sorry... I found the 'compile to library' thread and there it explains what it does.

"When you choose this option all the modules except of the main activity are compiled into a library."


Is the default manifest like below data skipped?

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
 

sorex

Expert
Licensed User
Longtime User
For some reason I still need to add the manifest lines to my test project aswell or it won't work right.
 

sorex

Expert
Licensed User
Longtime User
I was talking about the manifest data belonging to my class/library in my previous post.
 

sorex

Expert
Licensed User
Longtime User
ok, I had a few days of other things on my mind but I'm back on this topic.

The compile to library is handy for recurring parts of code that you use a lot in similar apps.

This results in a lot less code in the project itself.

The only thing I dislike is the fact that the manifest part is simply ignored.

Maybe your compile to library code should out a libraryname.manifest file that's been added to the project manifest during compilation.

so you get

library.jar
library.xml
library.manifest

or make it part of the xml

Now you still need to think about copying that code from somewhere (forum/other project) to the manifest yourself.
With one of the above solutions it's just part of the library.
 

sorex

Expert
Licensed User
Longtime User
thanks, that seems to be what I want despite that you still need to add the createfromresourcefile() line yourself.
what about auto including a default.b4x_excluded if it exists to prevent the manifest tweaking?

I have another question but I'll put it in that other thread.
 

sorex

Expert
Licensed User
Longtime User
You're right. the import doesn't parse the manifest file so if there is a createresourcefromfile() inthere it won't work and you have to add it to the manifest yourself anyway.

The manifest is a lot cleaner with these createresourcefromfile() lines. thanks for implementing that.
 
Top