Jan 15 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jan 15 | 4:00 PM |
Andrei | has entered the room |
Andrei |
Hello
|
Mark M. |
hello, Andrei!
|
Mark M. |
how can I help you today?
|
Andrei |
First of all, best wishes for the New Year! (even if we are 2 weeks already into it)
|
Mark M. |
either that, or you are 50 weeks early... :-)
|
Jan 15 | 4:05 PM |
Andrei |
:-) I have ported my project from Eclipse+ADT to Android Studio, now the app seems to work ok but I see a lot of errors in LogCat and I wonder if something goes wrong somewhere
|
Andrei |
This is the first line (out of 140), for example: 01-15 15:41:27.160 922-922/? E/logwrapper? executing /system/bin/e2fsck failed: No such file or directory
|
Mark M. |
that
|
Mark M. |
that's not coming from your process AFAIK
|
Andrei |
they don't seem to be related to my process, but I was wondering why so many errors, and whether I should be worried about them
|
Andrei |
View paste
|
Mark M. |
is this on the emulator?
|
Andrei |
yes
|
Mark M. |
with respect to the logwrapper message: http://stackoverflow.com/questions/21926448/and...
|
Andrei |
but as far as I remember they also appear when using a physical mobile phone
|
Mark M. |
I'd be surprised if those specific messages showed up on a device
|
Mark M. |
regardless, I am not aware of anything that is tied to your app for those messages
|
Andrei |
I can check in 2 mins
|
Jesus | has entered the room |
Jesus |
Hi
|
Mark M. |
(hello, Jesus -- I will be with you shortly!)
|
Andrei |
should I be worried about them?
|
Mark M. |
Andrei: I wouldn't be
|
Andrei |
(Hi)
|
Mark M. |
if they are not coming from your process, and you are not getting abnormal app behavior, I would not worry about them much
|
Jan 15 | 4:10 PM |
Mark M. |
particularly if they are just on the emulator
|
Mark M. |
if they are on hardware as well, that gets a bit more interesting, enough to maybe spend a few minutes of a Google search on
|
Mark M. |
but usually if you're doing something really wrong, there are stronger symptoms (poor app behavior, messages tied to your process, etc.)
|
Andrei |
I saw that StackOverflow answer earlier, but it was from Feb. 2014 and they said there that " This issue has been corrected for future distributions." I am however working with the latest Android Studio...
|
Mark M. |
again, I would not worry about messages from outside your process that appear solely on the emulator
|
Mark M. |
there are lots of those
|
Mark M. |
and it is unlikely that any are tied to your app, and they are more tied to the emulator being an emulator
|
Andrei |
ok, though it's so unusual for me to casually ignore errors... :-)
|
Mark M. |
let me take a question from Jesus, and I will be back with you shortly
|
Mark M. |
Jesus: your turn! do you have a question?
|
Andrei |
ok, in the meantime I'll try on a phone
|
Jesus |
Yes
|
Jesus |
So currently I am working on getting values from a server using http post
|
Jesus |
I upgraded parts of my program as I used to have it on pre 11 and it asked me to move it off the main network thread.
|
Jesus |
Now on the doInBackground I have it calling http request in order to get data and I am testing for errors such as breakdown if there is no internet connection
|
Jan 15 | 4:15 PM |
Jesus |
Is there a way to timeout async task operations in the do background
|
Jan 15 | 4:15 PM |
Mark M. |
well, usually the timeout would be done in the socket operations
|
Mark M. |
there is no built-in timeout facility in AsyncTask
|
Bill M. | has entered the room |
Jesus |
ok I figured so
|
Jesus |
So in the socket operation I have added a timeout and it tells me if that happens
|
Mark M. |
correct
|
Jesus |
But on the post execute I have it creating my gui operations such as a listview
|
Jesus |
now since the timeout occurs
|
Jesus |
it never gets to that point of creation
|
Mark M. |
(BTW, howdy, Bill -- I will be with you shortly!)
|
Jesus |
how can I catch that exception and still head to post execute portion
|
Mark M. |
wrap your network I/O in a try/catch block
|
Jesus |
hmm ok. I will try that
|
Mark M. |
let me take questions from the others, and I will be back with you shortly
|
Mark M. |
Bill: your turn! do you have a question?
|
Bill M. |
Yep. Howdi Mark. Sorry I missed you on Tuesday.
|
Jan 15 | 4:20 PM |
Bill M. |
I have a GCM app. I am building from source and it is working. However, I have never added my debug.keystore to the Google Developer Console and I still receive push notifications. Is this to be expected?
|
Mark M. |
I don't recall GCM requiring you to tie in signing keys the way the Maps V2 API does
|
Mark M. |
but, then again, I haven't looked at GCM much recenly
|
Mark M. |
er, recently
|
Bill M. |
Hmmm ... maybe my data is dated. The source says: http://developer.android.com/google/gcm/gs.html
|
Mark M. |
nothing in there refers to signing keys
|
Mark M. |
you need a GCM API key
|
Mark M. |
and that is tied to your server IP address
|
Mark M. |
and you need a project number associated with that GCM API key, but that too has nothing to do with app signing keys
|
Mark M. |
so, yes, what is working for you should be working :-)
|
Jan 15 | 4:25 PM |
Mark M. |
let me take questions from the others, and I will be back with you in a bit
|
Mark M. |
Andrei: your turn! do you have another question?
|
Bill M. |
I think my data is dated :) http://code-preview.herokuapp.com/apis-sdks/jou...
|
Bill M. |
I'll dig in. Thanks Mark.
|
Andrei |
Yes. Just tested on my phone and this is a surprise for me: yesterday the app worked on my phone, now it doesn't - I get a popup window saying "Aplication XXX (process YYY) is waiting for the debugger to attach" (with the option to force close it). In the LogCat I get 115 error lines, with errors different than those for the emulator. It starts with:
|
Andrei |
View paste
|
Mark M. |
again, those are not tied to your app
|
Andrei |
maybe, but the app is not working now, so I guess something is not right, somewhere
|
Mark M. |
for example, MtpService AFAIK is the daemon that handles the Android side of the MTP connection (the protocol used for mounting external storage as a drive or volume on a desktop OS)
|
Mark M. |
if you have a stack trace coming from your process, that's something you need to address
|
Mark M. |
if you are stuck on the "waiting for the debugger", then I don't know what to tell you, other than you may have an overloaded developer machine
|
Mark M. |
and if your app is not crashing but is just generally misbehaving... well, I can't really do a lot for you with regards to that :-)
|
Andrei |
ok. I'll try again, you may reply to others in the meantime
|
Mark M. |
OK
|
Mark M. |
Jesus: your turn! do you have another question?
|
Jesus |
Yes
|
Jesus |
View paste
|
Jesus |
so I tried this
|
Jan 15 | 4:30 PM |
Jesus |
the getById is the network call
|
Mark M. |
and your doInBackground() is returning a boolean?
|
Jesus |
yes and it returns true from checking with my post execute
|
Jesus |
in the error log it shows me that the mOrder object is null
|
Jesus |
and that there was a timeout exception
|
Mark M. |
then you are probably catching the exception in getByID(), or something that getByID() itself is doing
|
Mark M. |
and that is logging the timeout exception
|
Jesus |
yes so I think this might be it
|
Jesus |
I have a dialog box opening if it detects bad network connection
|
Jesus |
View paste
|
Jesus |
it gives me this error
|
Jesus |
for dlgAlert.create().show();
|
Mark M. |
you cannot readily pop a dialog from a background thread
|
Jesus |
oh this is in the post execute
|
Mark M. |
your timeout would have already occurred by then, as the timeout is happening in the doInBackground() processing
|
Mark M. |
(specifically somewhere inside getByID())
|
Jesus |
ok I will look into that
|
Jesus |
Thanks
|
Mark M. |
now, as to why you are having a problem in onPostExecute() showing a dialog, that I cannot say, as I avoid dialogs as much as possible
|
Jesus |
Oh why
|
Mark M. |
modal dialogs are considered bad form in mobile design
|
Mark M. |
use them very sparingly
|
Jan 15 | 4:35 PM |
Mark M. |
for error messages, use a crouton or something else inline in your UI, rather than blocking navigation
|
Mark M. |
(where by "crouton" I mean something like https://github.com/keyboardsurfer/Crouton)
|
Jesus |
Oh I remember that in the guidelines. Ok I can try that. Thanks again!
|
Mark M. |
anyway, let me take questions from the others, and I will be back with you in a bit
|
Mark M. |
Bill: your turn! do you have another question?
|
Mark M. |
Bill: if you come up with a question, chime in and let me know
|
Mark M. |
Andrei: do you have another question?
|
Andrei |
I've relaunched Android Studio and now my app runs on the mobile phone, but I still get those errors.
|
Andrei |
I'm always baffled by the moods of Android Studio or Eclipse+ADT ...
|
Mark M. |
Android, and device manufacturers, log lots of stuff, sometimes with inappropriate severities
|
Mark M. |
I yell at them when I get the chance
|
Jan 15 | 4:40 PM |
Andrei |
but this is not only about the logged errors, it's about an app that now runs and two minutes later doesn't run (or viceversa), without me modifying anything in the source code
|
Mark M. |
and there's little that I can tell you about that, as I do not know anything at all about your app, what it does, what it depends upon, etc.
|
Mark M. |
that's just a question of debugging
|
Mark M. |
and it is *very* unlikely to have anything to do with your choice of IDE
|
Andrei |
Maybe, I just wish there were relevant messages in the Logcat, to point me what is wrong...
|
Andrei |
Thanks for your help in any case!
|
Mark M. |
sorry I could not be of greater use
|
Mark M. |
Jesus: do you have another question?
|
Jesus |
Hmm. This is more related to stack overflow question I never got answered a long time go
|
Jesus |
I recently joined this so I was wondering if you could look into at some point I worked out what I could from previous related questions
|
Jan 15 | 4:45 PM |
Mark M. |
I am sorry, but I did not understand that last sentence
|
Mark M. |
if you have a question on Stack Overflow that you would like me to look at, you are welcome to link to it here, or use the Stack Overflow Bump service that is available on the Warescription site
|
Jesus |
alright let me find the link
|
Jesus | |
Mark M. |
ummm... hold on a moment
|
Mark M. |
well, in principle, you should be able to call setChoiceMode() to toggle on and off MULTIPLE_MODAL behavior
|
Jesus |
So I learned how to use isEnabled and areAllItemsEnabled in order to see disable specific items during the isActionMode. What I could not figure out was how to disable the MultiChoice behavior
|
Mark M. |
in this sample, I toggle between CHOICE_MODE_NONE and CHOICE_MODE_MULTIPLE_MODAL: https://github.com/commonsguy/cw-omnibus/tree/m...
|
Jan 15 | 4:50 PM |
Mark M. |
that sample is covered in my chapter on action modes
|
Mark M. |
there, I start in single-choice mode, and on a long-click move into multiple-choice-modal mode
|
Mark M. |
and I switch back when I am done with the action mode
|
Mark M. |
you should be able to do the same sort of thing, switching between single-choice and multiple-choice-modal modes
|
Mark M. |
or, at least, it is worth a shot
|
Jesus |
so I could possibly set listview item to only single click if it meets the criteria I set
|
Mark M. |
right
|
Jesus |
ok I will look at that thanks again
|
Mark M. |
sure
|
Mark M. |
Bill: do you have another question?
|
Mark M. |
OK, does anyone have another question?
|
Andrei |
not me
|
Jesus |
I'm good for today
|
Jan 15 | 4:55 PM |
Jesus | has left the room |
Andrei |
Good bye
|
Andrei | has left the room |
Jan 15 | 5:00 PM |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Tuesday at 9am US Eastern
|
Mark M. |
have a pleasant day!
|
Bill M. | has left the room |
Mark M. | turned off guest access |