Android Question B4A Versions Question

Richard O'Sullivan

Member
Licensed User
Hi All,

I recently upgraded to B4A 8.30.

I simply overwrote my previous version with the new program.
My question is - do you change the install location so that you can test a build with an older version?

If so - what is the best suggestion to do so?

My 2nd question is regarding the Target SDK in the Manifest.
With 8.30 this was set as Target 26 in the manifest but when I tried to change it down to 23 it would not allow a downgrade.
I am getting an SQLite unknown error (code 14) on an Android 6.0.1 device using the attached sample programs - WOTrack (built with ver 7.8) works fine but WOTrackTest which was built with 8.30 raises the error.
Both work fine on a Nexus 7 android ver 5.1.1

Any thoughts greatly appreciated.

Richard
 

Attachments

  • WOTrack.zip
    34.8 KB · Views: 138
  • WOTrackTest.zip
    34.9 KB · Views: 124

Erel

B4X founder
Staff member
Licensed User
Longtime User
The B4A version has nothing to do with the problem you encounter.
Please read this very important tutorial:
android.jar / targetSdkVersion / minSdkVersion

The problem happens because of the targetSdkVersion.
One project sets it to 19 and the other sets it to 23. The one with 23 must properly handle runtime permissions.

Runtime Permissions (Android 6.0+ Permissions)

If you can avoid saving in File.DirRootExternal then it will be simpler.

Watch the runtime permissions video tutorial:

 
Upvote 0

Richard O'Sullivan

Member
Licensed User
Erel,

Thanks for your quick response.

I was not aware that such sweeping changes will be affecting Android.

I like using File.DirRootExternal as it is visible in Windows Explorer for copying files etc.

Google can be quite over-powering in what they will allow us do with Our devices. Maybe sensible in some instances but still restricting for us.

Thanks

Richard
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
If so - what is the best suggestion to do so?
Hello Richard:
I fixed your second project WOTrackTest to work with Runtimepermissions since your target SDK is 23. Attached is a working copy that shows you how to handle permission to use File.DirRootExternal as the store for your database. Make sure to add the runtimepermissions lib:
 

Attachments

  • WOTrackWithRunTimePermissions.zip
    35.1 KB · Views: 135
Upvote 0

Richard O'Sullivan

Member
Licensed User
Mahares,

Thanks for the effort - I'd like to stick with using File.DirRootExternal.

Im getting this error - maybe my Library version?


B4A Version: 8.30
Parsing code. (0.00s)
Compiling code. (0.04s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight

Richard
 
Upvote 0

Richard O'Sullivan

Member
Licensed User
All working fine now.

Thank you Erel and Mahares.

Mahares - thank you for the sample code - it is always very helpful when an example is presented.

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