|
hooah posted:But the second way creates a new object every time, right? Is the language ease worth the overhead in this case? Generally the answer to these sorts of questions is: don't worry about it unless it becomes a problem.
|
# ? Jul 21, 2015 17:35 |
|
|
# ? May 26, 2024 23:28 |
|
I have a tetris APK that works on my phone, but not on my tablet. Any idea what is going on? Both devices are running android 5.1.1. It will launch, then immediately crash, the app stays in the tray. I have the logcat here http://pastebin.com/DCnYfpMe
|
# ? Jul 21, 2015 23:16 |
|
I'm not seeing anything super helpful in the log. It's failing to find a binder at the end which could relate to a cross-process background service being killed for some reason but that may just be the final result of an actual error that's occurring earlier somewhere and causing the service to die. Edit: The OS source code that throw that error suggests that it's the window that is missing, so most likely this isn't the actual cause of the issue but is what happens after something failed to initiate properly. It could just be that it's trying to use a specific feature that the device tablet support. Could also be something to do with portrait vs. landscape. Edit edit: There's also some low level stuff (NDK) happening and some things referencing tegra. The game might be GPU-specific or there might be different APKs for different GPU types. Tunga fucked around with this message at 23:40 on Jul 21, 2015 |
# ? Jul 21, 2015 23:33 |
|
The error is the earlier one - the binder stuff is because the window has already been closed due to:code:
And yeah, stack size has exceeded 1MB (default pthread stack size for NDK), which it probably shouldn't.
|
# ? Jul 22, 2015 08:43 |
|
Not specifically developer oriented, but here goes: Does anyone know the syntax that dates (with timestamps) can have in SMS's in order for them to be "clickable" so that a person can create an appointment in their calendar from it? I seem to recall from back when I had an iPhone, that if I got an SMS like this: "We confirm your dentist appoint on 21/7/2015 8:00" ... it would have the date and time underlined and be able to create an appointment in my calendar when I tapped on it.
|
# ? Jul 22, 2015 10:05 |
|
The platform autolink tag doesn't match dates, so any such functionality would be implemented with app-specific logic.
|
# ? Jul 22, 2015 10:59 |
|
How do I go about generating a signed apk that I can install on my phone? I followed the directions here, but when I tried to install that I got a super helpful message: "App not installed". What might I have missed?
|
# ? Jul 23, 2015 20:49 |
|
Do you already have a debug version of the same app installed? You can't install two apps with the same package name but signed with different keys.
|
# ? Jul 24, 2015 07:31 |
|
That was true, but after uninstalling the debug version and successfully installing the release version, it still doesn't show up in the app drawer.
|
# ? Jul 24, 2015 13:19 |
|
Still having that problem, but also an additional stumbling block. I'm trying to add location to the logging. I've gone through Making Your App Location-Aware, but for some reason onConnect doesn't get called. I thought maybe it was failing to connect, so I threw a breakpoint in onConnectionFailed, but that isn't getting called either. What else could I try to figure out what's going on? Here's the location-relevant parts of my class; Java code:
|
# ? Jul 27, 2015 19:25 |
|
You aren't setting the connection callback so the API client doesn't know who to call the onConnect or onConnecitonFailed on. Check this out from Google's example, specifically this chunk:code:
kitten smoothie fucked around with this message at 23:52 on Jul 27, 2015 |
# ? Jul 27, 2015 23:49 |
|
I didn't really understand all the builder parts (because I was lazy). Getting location now! I have an organizational question regarding that tutorial - why did they break out the client-building code into a function? Isn't it only going to be called once? Next thing: I'm trying to implement a share button for the log files so the ultimate users don't have to dig into the file system to send them. I read the first two sections of this tutorial, but then it goes off into receiving file share intents, rather than sending the URI. Do I just do a share intent a la this tutorial and send over the URI?
|
# ? Jul 28, 2015 14:14 |
|
I'm getting a little further along with sharing. Currently I'm trying to send the first file in the directory as an email attachment. I have implemented the share menu item like so:Java code:
|
# ? Jul 30, 2015 13:27 |
|
Your file is in app private storage. Gmail doesn't have permission to access it. You can either change the permissions, or use a FileProvider to vend the file securely.
|
# ? Jul 30, 2015 23:52 |
|
Ah, that makes sense. I've gotten that straightened out, and read through the tutorial at the top of the FileProvider documentation. However, when I choose Gmail as the recipient of the intent, the content URI gets put into the To: field, rather than the file getting attached. I tried using Drive instead and got a toast saying "Upload was unsuccessful: request contained no data". Here's my current code dealing with that menu item:Java code:
|
# ? Jul 31, 2015 14:23 |
|
I'm not even going to try to diagnose this. Just put your file in publicly visible external storage.
|
# ? Aug 3, 2015 00:13 |
|
For an ACTION_SEND intent, you should put the content uri in the EXTRA_STREAM extra rather than in the intent data.
|
# ? Aug 3, 2015 04:07 |
|
Volmarias posted:I'm not even going to try to diagnose this. Just put your file in publicly visible external storage. How would that help? The URI seems to be accessible, it was just getting put in the wrong part of the intent. Jabor posted:For an ACTION_SEND intent, you should put the content uri in the EXTRA_STREAM extra rather than in the intent data. This worked like a charm, thank you.
|
# ? Aug 3, 2015 14:12 |
|
hooah posted:How would that help? The URI seems to be accessible, it was just getting put in the wrong part of the intent. If you use a public external storage directory, there's no per-app permissions, so you wouldn't need a FileProvider, you could just give the file uri from there. Glad to hear you got it working though!
|
# ? Aug 4, 2015 00:17 |
|
I've discovered that you should calibrate the linear acceleration sensor each time the app's run. I though "ok, I'll just slap a message on the main activity and a button to calibrate the sensor". To do this, I moved the creation of my SensorWrangler object (wrapper for the acceleration and rotational sensors) from DisplayData to MainActivity. Then obviously I have to either tell the DisplayData class about the offsets or pass the SensorWrangler to that activity. I tried the latter by having SensorWrangler implement Serializable, but got an error "Parcelable encountered IOException writing serializable object (name = com.example.me.accel_demo.SensorWrangler)". Does this mean I can't pass that object, since the Sensor objects aren't serializable?
|
# ? Aug 5, 2015 14:48 |
|
There may be a member variable or similar on SensorWrangler of a type that isn't Serializable. I believe that would cause the error you're seeing. If the offset is just numbers or similar it'll most likely be easier to stick a couple of ints in the Intent bundle and then construct and setup the object with that. (Also, on Android consider using Parcelable instead of Serializable, it's generally more efficient.) Edit: If you're running a thing that monitors sensor input and accessing it from different activities the way I would do that is to have the sensor stuff running in a service and then each activity binds to it when it needs to use it. But this may not be compatible with your current architecture.
|
# ? Aug 5, 2015 15:36 |
|
Can't you just do it as part of the wrangler's initialisation or something? Maybe have a static flag that tells you whether the calibration has been run yet, and run that method if you need to. Or is this a 'lay it flat' thing? I don't know which offsets you mean, but if you have to offset each value to produce the true calibrated value every time, why not do that in the getData method in the wrangler? That's sort of the idea with encapsulation, you have issues like that hidden within the thing that cares about them. The technical stuff is dealt with internally, and then it just produces the simple output as usual, and none of your other components need to change or even know about it
|
# ? Aug 5, 2015 15:43 |
|
Tunga posted:If the offset is just numbers or similar it'll most likely be easier to stick a couple of ints in the Intent bundle and then construct and setup the object with that. This was my other option, but it seems that that requires setting up another SensorListener in the MainActivity for the sole purpose of getting the offset. If that's what it takes, then that's fine. quote:Edit: If you're running a thing that monitors sensor input and accessing it from different activities the way I would do that is to have the sensor stuff running in a service and then each activity binds to it when it needs to use it. But this may not be compatible with your current architecture. This might be a good route to take eventually. baka kaba posted:Can't you just do it as part of the wrangler's initialisation or something? Maybe have a static flag that tells you whether the calibration has been run yet, and run that method if you need to. Or is this a 'lay it flat' thing? The calibration is a "lay it flat" thing, so it needs to be done before the data collection starts, at the latest.
|
# ? Aug 5, 2015 17:27 |
|
Does anyone know where I can find GDB compiled for an ARM host? Remote debugging isn't working but uploading gdb to my device and debugging from there does work. Unfortunately the latest version I can find is 7.2 which has a bug causing a segfault during the transition to THUMB mode. If all else fails I guess I can compile it from an intel machine but it is probably going to take me all day to get everything set up for that and I'd love to not do that if I can
|
# ? Aug 8, 2015 04:46 |
|
For some reason, Google's own CountDownTimer (https://developer.android.com/reference/android/os/CountDownTimer.html) example code doesn't quite work as expected. I changed the start value from 30,000 to 5,000 (5 seconds vs. 30), and the timer starts at 4, but stays on 1 for two seconds, so it's still a 5-second timer. I know the problem is with the somewhat lazy way they're outputting the whole number, but I can't think of a nice way to make the timer look the way you'd expect.
|
# ? Aug 11, 2015 18:39 |
|
In the source code of CountdownTimer it checks if the time remaining is smaller than the tick time and if it does then it just waits. This happens before it checks whether a tick is due, so if the last tick gets delayed by even 1ms then it simply won't fire. I'd imagine the easiest way to fix this is just to have the thing fire every 100ms or similar instead, and still just display the whole seconds. If you want a better solution than that, implement your own correctly behaving countdown timer using a Runable and enjoy the fact that you can write better code than Google.
|
# ? Aug 11, 2015 19:22 |
|
Hi all! I'm putting together an inventory of common (or even not-so-common) Android application security issues. Things like mishandling intent/activity activation, putting private stuff in logcat, data-at-rest vulnerabilities and so forth. I've found a couple of decent resources, such as the AppSec pen test overview (https://appsec-labs.com/android_attacks-tests/) but I thought I'd ask if people had other good places to look. (Related: I'm hiring Android systems/app security expertise.)
|
# ? Aug 12, 2015 20:01 |
|
I'm working with another student on this app, and he's mainly doing the data analysis stuff. He told me today that sometimes the same simple movement (perhaps sliding the phone in one axis on the table) will appear on different axes in his visualizations, and other times different movements will appear on the same axis. We've both looked at the linear acceleration documentation, and it doesn't say anything about this. Where should we start looking to figure this out?
|
# ? Aug 13, 2015 23:07 |
|
hooah posted:I'm working with another student on this app, and he's mainly doing the data analysis stuff. He told me today that sometimes the same simple movement (perhaps sliding the phone in one axis on the table) will appear on different axes in his visualizations, and other times different movements will appear on the same axis. We've both looked at the linear acceleration documentation, and it doesn't say anything about this. Where should we start looking to figure this out? Look at the orientation of your phone as you move it. If you move it sideways, that will give you a different bump than moving it longways. I also would not be surprised in the slightest at an OEM screwing up which axis gets reported.
|
# ? Aug 15, 2015 03:01 |
|
The sensors in Android devices are, you'll be shocked to hear, of variable quality! The linear acceleration sensor is actually a fusion of the accelerometer and some gravity-detecting gear, like the magnetometer, a gyroscope if your device has one, or maybe other hardware. Exactly how it's implemented (and the quality of the results you'll get) is really up to the device, and some hardware is better than others. Also the accelerometer is basically a tiny spring (kinda), it boings back and forth when you move the device. They're really sensitive and jittery, and I wouldn't be surprised if you're seeing motion in other axes when you think you've only moved along one - if you're sliding it think impact vibration, friction, sliiight rotations of the device and a path that isn't absolutely laser-precise along the axis you intended. These shouldn't be big differences if you're being careful, especially once it gets going. Anyway you're probably gonna want to look into filtering out all this noise Not really about what you're asking specifically, but the start of this gives you an idea of some of the nonsense you have to worry about http://www.kircherelectronics.com/blog/index.php/11-android/sensors/17-gyroscope-linear-acceleration Now you're realising what you got yourself into :cigar:
|
# ? Aug 15, 2015 03:39 |
|
Subjunctive posted:Hi all! Not sure how relevant it is, but I just remembered one particularly hilarious Android exploit for devices using Samsung's Exynos chipset: /dev/exynos-mem was readable and world-writable which referenced – you guessed it – device memory. In case you don't already have it in your list of attacks, here's more info on that vulnerability: http://blog.azimuthsecurity.com/2013/02/re-visiting-exynos-memory-mapping-bug.html
|
# ? Aug 15, 2015 03:55 |
|
Doctor w-rw-rw- posted:Not sure how relevant it is, but I just remembered one particularly hilarious Android exploit for devices using Samsung's Exynos chipset: /dev/exynos-mem was readable and world-writable which referenced – you guessed it – device memory.
|
# ? Aug 15, 2015 04:02 |
|
Oh man, you just heard about that? A friend of mine still works for Samsung, and had to explain Unix permissions to their security team and why this was such a bad thing. I poo poo you not. Apparently they've gotten a little better since then, though apparently not by much.
|
# ? Aug 17, 2015 04:18 |
|
Volmarias posted:Oh man, you just heard about that? A friend of mine still works for Samsung, and had to explain Unix permissions to their security team and why this was such a bad thing. I poo poo you not. Yeah, I haven't been paying attention to Android for a couple of years, and now I feel like I need to go back and binge-watch all the episodes.
|
# ? Aug 17, 2015 06:30 |
|
Subjunctive posted:Yeah, I haven't been paying attention to Android for a couple of years, and now I feel like I need to go back and binge-watch all the episodes. It's definitely entertaining in a train wreck sort of way. The current issue of the month is vulnerabilities in the stagefright media library allowing to RCE at system level via a well
|
# ? Aug 17, 2015 12:37 |
|
Oh, and don't forget that the patch didn't fully patch the problem. I'm really curious how many full time Android developers carry iPhones as their personal device, because we have a bigger window into the sausage factory.
|
# ? Aug 17, 2015 15:26 |
|
kitten smoothie posted:I'm really curious how many full time Android developers carry iPhones as their personal device, because we have a bigger window into the sausage factory.
|
# ? Aug 17, 2015 15:57 |
|
Volmarias posted:It's definitely entertaining in a train wreck sort of way. The current issue of the month is vulnerabilities in the stagefright media library allowing to RCE at system level via a well Yeah, I've been following Stagefright stuff since I got back into Android security recently. It's a beaut. There are always going to be devices that will never be patched (including iPhones), of course. At least this seems to have lit a fire under Samsung WRT update schedule?
|
# ? Aug 17, 2015 16:15 |
|
Subjunctive posted:Yeah, I've been following Stagefright stuff since I got back into Android security recently. It's a beaut. There are always going to be devices that will never be patched (including iPhones), of course. On one hand it's sad that we'll have "Patch Tuesday" for Android, but at least poo poo might start getting patched. In other news, the 6.0 SDK is up in the SDK manager.
|
# ? Aug 17, 2015 18:42 |
|
|
# ? May 26, 2024 23:28 |
|
kitten smoothie posted:On one hand it's sad that we'll have "Patch Tuesday" for Android, but at least poo poo might start getting patched. Better than "Patch November", yeah.
|
# ? Aug 17, 2015 18:51 |