Android Question myPOS

DonManfred

Expert
Licensed User
Longtime User
You need to write a library with java for it.

Alternatively you can use JavaObject to interact with the Library.
 
Upvote 0

Ale_resource

Member
Licensed User
I created a new project by simply integrating the .aar file

Main:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

#AdditionalJar : slavesdk-release.aar

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
    xui.MsgboxAsync("Hello world!", "B4X")
End Sub

and on the manifest file I inserted this

Manifest:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

AddPermission(android.permission.INTERNET)
AddPermission(android.permission.BLUETOOTH)
AddPermission(android.permission.BLUETOOTH_ADMIN)
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.VIBRATE)

I tried to compile but immediately miesce an error that I attach in the image
 

Attachments

  • Cattura.JPG
    50.3 KB · Views: 257
Upvote 0

Ale_resource

Member
Licensed User
I solved it by entering this :
Main:
#AdditionalJar : slavesdk-release.aar
#AdditionalJar: com.android.support:appcompat-v7
#AdditionalJar: com.android.support:design
#AdditionalJar: com.android.support:support-v4
#AdditionalJar: com.android.support:gridlayout-v7
#AdditionalJar: com.android.support:cardview-v7
but when I compile I have the error shown in the image below
 

Attachments

  • Cattura.JPG
    104.4 KB · Views: 230
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
As you posted a Screenshot that told that you are using AndroidX.
In this case it is a mistake to import any Android Support artifacts!

You need to add the relevant AndroidX Artifacts.

See androidx-artifact-mapping.csvand androidx-class-mapping.csv in B4A-Installationfolder

Have you jetified the libraries after adding the AAR?
 
Upvote 0

Ale_resource

Member
Licensed User
I changed this and now I have no more compilation errors

main:
#AdditionalJar : slavesdk-release.aar
#AdditionalJar: com.android.support:appcompat-v7
#AdditionalJar: com.android.support:design
#AdditionalJar: com.android.support:support-v4
#AdditionalJar: com.android.support:gridlayout-v7
#AdditionalJar: com.android.support:cardview-v7
#MultiDex: True
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
#AdditionalJar: com.android.support:appcompat-v7
#AdditionalJar: com.android.support:design
#AdditionalJar: com.android.support:support-v4
#AdditionalJar: com.android.support:gridlayout-v7
#AdditionalJar: com.android.support:cardview-v7
Did you read my last Answer?

I´ll answer it for you: NO

NONE of these Imports are correct.
 
Last edited:
Upvote 0

Ale_resource

Member
Licensed User
Because your Screenshot in #3 is telling that you ARE using AndroidX. And NOT com.android.support.*

Read my answer.
sorry but it is an operation that I had never done, I created a folder where I put the .aar file, then I made the Jetifier ... now so the library is included automatically or do I always have to put the reference?
Isn't there a guide?
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…