B4A Code Snippet Workaround the NetworkOnMainThread exception - Erel    
Apr 10, 2025   
(24 reactions) As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder...", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode"...
B4A Question Playstore: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation - Jmu5667    
Oct 7, 2021 on a Samsung Galaxy S9 Android 8.0 (SDK 26)
is the following:
Stack trace #1
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/os/Message;->flags:I
at android.os.StrictMode.lambda$static$1(StrictMode.java:407)
at android.os....ZygoteInit.main(ZygoteInit.java:1076)
Stack trace #2
StrictMode policy violation: android.os.strictmode...
link: Google runs a static analyzer over the bytecode. This code will never run and will not cause any problem (unless you use the deprecated DoEvents or Msgbox calls)....
Other [TIP] StrictMode Policy Violations - Computersmith64    
Aug 21, 2019   
(3 reactions)I see a few posts on here regarding concerns about StrictMode policy violations being reported in... internal testing track.
Here's a link to the Android Developer documentation regarding StrictMode policy violations:
https://developer.android.com/reference/android/os/StrictMode
The upshot is that you don't need to be concerned about fixing every violation reported. StrictMode is more... of an issue. It's worth having a quick read of the StrictMode documentation.
- Colin....
B4A Library [Lib] StrictMode - Informatix    
Jun 11, 2013   
(8 reactions)This library enables the StrictMode. It's useful to detect memory leaks, SQL cursors still...):
Dim SM As StrictMode
SM.EnableStrictModeForAll(True, False)
The report is made in the system log...
link: Hi, is there any similar library for B4J?
No....
link: Hi, is there any similar library for B4J?...
link: Is it legal to disable strict mode on google play?
It's allowed, of course....
B4A Question StrictMode policy violation [...] Landroid/graphics/drawable/GradientDrawable$GradientState - b4x-de (first post)    
Mar 24, 2021Hi,
I had the same issue. It caused my App to crash on Android 10. After updating B4A to version 10.5 and setting android:targetSdkV...
link: This is only a warning and you should ignore it. It will do no harm....
link: i was looking at them i saw the following error:
StrictMode policy violation: android.os.strictmode...
B4A Question jdbcSQL, strictMode (enable/disable) - mw71 (first post)    
May 8, 2020Erel, thank for Anser.
It will probably work.
I have test permitNetwork, looks work fine.
I wouldn't try to enable it again. I...
link:
It is OK. replace permitAll with permitNetwork ??
It will probably work.
I wouldn't try to enable it again. It will only cause...
link: Hi,
I tested this code:
https://www.b4x.com/android/forum/threads/jdbcsql-directly-connect-to-remote-databases.84016/
works well fo...
B4A Question Can b4a run in StrictMode? - techgreyeye (first post)    
Feb 10, 2020Thanks Erel. That sorted my leaking cursors....
link: See the third search result: https://www.b4x.com/android/forum/pages/results/?query=strictmode...
link: Is there any way of building in B4A so the app runs in strict mode?
I have an app that's leaking SQLite cursors, and it seems th...
B4A Question pre launch report: StrictMode policy violation - Zoran Vujacic (first post)    
Aug 21, 2019   
(1 reaction)Hello,
You're right for the ID, but it's too late.
However, I decided that the application s...
link: Hi,
https://play.google.com/store/apps/details?id=simple.batttery.alarm
Email from AdSense:
Curren...
link: These warnings have nothing to do with the AdMob issue you encountered.
You should ignore them. The...
link: In attached are errors before (I use AdMob and MsgBox)
Ljava/nio/Buffer;->address:J
Landroid/cont...
B4A Code Snippet Sending push messages from B4A - Erel    
Oct 20, 2024   
(15 reactions) As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder...", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode...
link: As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy...
link: .StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1448) com.android.okhttp.internal.huc.HttpsURLConnectionImpl...
B4A Question StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1128) - FFMan (first post)    
Jun 3, 2014ok - did some more digging and switch to httputils2 which moved me on a stage
case closed (for now :-)...
link: I am developing some code to perform a get which elicits a json response.
On occasions, and more recently it crashes with the above error when executing this line:-
SearchWord = Response.GetString(&...
Page: 1  
2  
3  
4  
5  
6  
7