android-strictmode

Attempting to follow basic How to connect Android with PHP, MySQL tutorial: application crashes - cannot import android.os.StrictMode

℡╲_俬逩灬. 提交于 2019-12-11 06:23:48
问题 Ok - so I'm using the following tutorial: "How to connect Android with PHP, MySQL" However almost everyone who attempts the tutorial (judging from the comments) is having force close issues due to the application only being designed to run on API level 8 or earlier. Several users have developed a fix for this involving adding the following lines of code in EditProductActivity.java file // this part only to identify where to put the working code public void onCreate(Bundle savedInstanceState)

Adview loadAd() triggering a StrictMode violation

二次信任 提交于 2019-12-10 17:32:50
问题 I am trying to add some adds in my application. When I have StrictMode enabled, I get a bunch of policy violations like this one (maybe 6 or 7 of these). Is this normal? 18817-18817/com.xyz.xyz.xyz D/StrictMode: StrictMode policy violation; ~duration=67937 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=5439503 violation=2 at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263) at libcore.io.BlockGuardOs.fstat(BlockGuardOs.java:132) at java.io

Strict mode violations list

早过忘川 提交于 2019-12-10 14:37:25
问题 running adb logcat in the shell i see something like this StrictMode policy violation; ~duration=337 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2 what the policy=23 means ? what is violation=2 ? I was searching for the meanings of this values but I couldn't find any documentation whit violation and policy list, or maybe I interpreted the results from my search in a bad way, but I will appreciate some explanation about this 回答1: what the policy=23 means ? You

Android strict mode detects multiple activity instance violation, but I have no idea why

て烟熏妆下的殇ゞ 提交于 2019-12-05 12:42:40
Code is probably too complex to post here in full, but here is the basic schema: I have two Activity subclasses, each of which hosts a ListView . Each ListView has an adapter of a custom class, which generates View instances also of a custom class. These lists are showing data items that are generated asynchronously in another thread; as it needs to know where to send updates to, the data objects it manipulates have WeakReference<> objects that are set to hold references to the adapters displaying their contents when they are initialised. When an object in the list of the first activity is

StrictMode java.lang.Throwable: Untagged socket detected

痴心易碎 提交于 2019-12-05 00:47:52
问题 With StrictMode enabled I just started getting this exception: java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage 回答1: There are a couple of ways to handle this exception. First, you have to inspect the stack trace and make sure it is your code reporting the violation. For example, have a look at the following trace. D/StrictMode: StrictMode policy violation: android.os.strictmode.UntaggedSocketViolation: Untagged socket detected;

Opening a sub-activity several times causes an InstanceCountViolation despite being destroyed

守給你的承諾、 提交于 2019-12-04 03:16:44
I'm working on a project that has a lower level activity called RecordView to display record details such as an image, the date and time it was taken, and the latitude/longitude information. Rather than trying to manipulate the camera to geotag and access exif data I'm trying to implement a location listener to get the location where the image is first taken (on the button press). This approach works - I get my location to display and update the record in the database correctly (returning to the view later displays the location from the beginning). However, if I back out of the current

StrictMode java.lang.Throwable: Untagged socket detected

拥有回忆 提交于 2019-12-03 16:56:21
With StrictMode enabled I just started getting this exception: java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage Java42 There are a couple of ways to handle this exception. First, you have to inspect the stack trace and make sure it is your code reporting the violation. For example, have a look at the following trace. D/StrictMode: StrictMode policy violation: android.os.strictmode.UntaggedSocketViolation: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage at android.os.StrictMode

Detecting forgotten SQLite transaction on Android using StrictMode?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:40:01
Executing multiple SQL statements without putting them into one transaction is a severe bottleneck (see e.g. http://www.sqlite.org/faq.html#q19 ). I haven't thoroughly checked how SQLite is configured on Android, but anecdotally I perceived dramatical performance increase within my on app when using transactions in more places. Is it possible to detect instances where one forgets to use transactions using StrictMode? If not, could that be considered for a future release of StrictMode? It might be somewhat tricky to detect, but two different strategies could be, 1) non-select statements outside

DropBoxManager use cases?

青春壹個敷衍的年華 提交于 2019-12-03 04:25:25
问题 I noticed that a DropBoxManager has been introduced in Android API since FroYo (API 8). It looks like an alternative logger capable of logging not only text but also files or byte arrays, but I could not find any detailed doc anywhere about how and when we should use it. The latest android dev blog post introducing StrictMode talks about it, StrictMode can append data to the DropBox, and we are given a shell command to retrieve these data. Please share here your knowledge about this! Why has

DropBoxManager use cases?

爷,独闯天下 提交于 2019-12-02 17:40:45
I noticed that a DropBoxManager has been introduced in Android API since FroYo (API 8). It looks like an alternative logger capable of logging not only text but also files or byte arrays, but I could not find any detailed doc anywhere about how and when we should use it. The latest android dev blog post introducing StrictMode talks about it, StrictMode can append data to the DropBox, and we are given a shell command to retrieve these data. Please share here your knowledge about this! Why has it been implemented in addition to the usual logcat? Can we use this to share data across apps? What