Mark M. | has entered the room |
Mark M. | turned on guest access |
IpiRon | has entered the room |
IpiRon |
Hello to all
|
Mark M. |
hello, IpiRon!
|
Mark M. |
how can I help you today?
|
MyWay | has entered the room |
MyWay |
hi all
|
IpiRon |
View paste
(8 more lines)
|
Mark M. |
hello, MyWay!
|
Mark M. |
MyWay: IpiRon beat you into the room by a bit, so I'll take his question first and will be back to you shortly
|
MyWay |
ahah, sure :)
|
Mark M. |
IpiRon: OK, I'm lost already :-(
|
Mark M. |
the third-party device is not an Android device, right?
|
IpiRon |
Correct
|
Mark M. |
and it connects to an Android device via USB OTG?
|
IpiRon |
Correct
|
Apr 16 | 4:00 PM |
Mark M. |
um, then unless there's a USB hub and an Android device can can simultaneously act as host and client, I don't think what you want to do with the hub is possible
|
Mark M. |
with normal adb debugging, the Android device acts as a USB client, not as a host
|
IpiRon |
Okay, are you familiar with debugging over ethernet?
|
Mark M. |
WiFi, yes; Ethernet, no, because most Android devices do not have Ethernet ports
|
Mark M. |
though it probably works the same
|
IpiRon |
Wifi would work for me. Can you point me to any instructions?
|
Mark M. |
you are looking for the "adb connect" command
|
Mark M. | |
IpiRon |
Are there ADB commands executes on my development PC or in the Android device?
|
Mark M. |
these are all on your development PC
|
Mark M. |
you briefly use a USB cable to "bootstrap" the WiFi debugging
|
Mark M. |
then, you should be able to switch over to using the USB port for your third-party device
|
IpiRon |
Okay, I'll check out the link and get back with you. You can proceed with next chatter!
|
Mark M. |
OK
|
Mark M. |
MyWay: over to you! do you have a question?
|
MyWay |
Mark, do you plan to add a small section about AccountManager in the book, to store users' credentials and so avoiding bad practices?
|
Mark M. |
do I plan to cover AccountManager someday? yes
|
Apr 16 | 4:05 PM |
Mark M. |
that being said, AccountManager is definitely "an acquired taste"
|
MyWay |
what do you mean?
|
Mark M. |
too many nasty-sounding permissions, for one
|
MyWay |
ah
|
MyWay |
so not in the short-term, probably
|
MyWay |
thank you anyway (I don't have other questions)
|
Mark M. |
I won't cover it until I have alternatives that provide good security that I can write about as well (e.g., storing generated keys in KeyStore)
|
MyWay |
ah, nice
|
Mark M. |
I understand your security concerns; I just don't think that AccountManager was especially well-thought-out
|
Mark M. |
if you come up with another question while you're still in the chat room, tap me on the virtual shoulder
|
Mark M. |
in the meantime...
|
Mark M. |
IpiRon: back to you!
|
MyWay |
sure, thank you
|
IpiRon |
The link you sent is a good place for me to start. I'm done for today. Thanks!!!
|
IpiRon | has left the room |
Apr 16 | 4:30 PM |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK!
|
Mark M. |
EGHDK: MyWay is currently out of questions, so... do you have a question?
|
EGHDK |
Hey Mark, hopefully a single simple question for you. I'm trying to get the intent flags from an activity but all I get is a number. How can I tell what the flag is?
|
Mark M. |
compare it to the values
|
Mark M. |
all those flags are numbers
|
Mark M. |
FLAG_ACTIVITY_BROUGHT_TO_FRONT is 0x00400000
|
EGHDK |
So what do I do for combined flags. Like using the pipe symbol
|
Mark M. |
those flags are usually just individual bits or simple bitmasks
|
Mark M. |
so, you would need to see if the bits in the value you get from the Intent have the bits that you are seeking from a flag
|
Mark M. | |
Apr 16 | 4:35 PM |
Mark M. | |
EGHDK |
Okay. I'll look into it. Thanks. Oh another question actually. On a reddit discussion someone asked how many httpclients an app should use. There wasn't a canonical answer but having a static httpclient in the app class seemed to be a favorite. Thoughts?
|
Mark M. |
if you literally mean HttpClient, the correct answer for the past couple of years has been "zero"
|
Mark M. |
Android's HttpClient was formally deprecated in Android 5.1, but Google has been steering developers away from it for a couple of years
|
EGHDK |
Well not Apache. I'm going to use okhttp
|
Mark M. |
you would have to check the OkHttp docs to see what scope they recommend
|
EGHDK |
But I don't know where to out my client and whether it should be static member of app class.
|
EGHDK |
Okay. I'll prod around some more
|
Mark M. |
again, the answer to that is VERY dependent on whose API you are using
|
Mark M. |
the answer for HttpClient could differ from OkHttp, which could differ from HttpUrlConnection, which could differ from Ion, etc.
|
Apr 16 | 4:40 PM |
EGHDK |
Interesting that it is dependent on that. It makes sense to me that one application would have one httpclient
|
Mark M. |
you are welcome to your opinion
|
Mark M. |
and with HttpClient itself, there are reasons for doing that
|
Mark M. |
however, different developers of different HTTP client libraries may have different philosophies
|
EGHDK |
Ok. I'll look into it more.
|
Apr 16 | 4:55 PM |
Mark M. |
we're running out of time -- anyone have any questions?
|
Apr 16 | 5:00 PM |
EGHDK | has left the room |
Mark M. |
well, 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 one is Wednesday at 7:30pm US Eastern
|
Mark M. |
have a pleasant day!
|
MyWay | has left the room |
Mark M. | turned off guest access |