Mark M. | has entered the room |
Mark M. | turned on guest access |
Refael O. | has entered the room |
Feb 16 | 9:00 AM |
Mark M. |
hello Refael!
|
Refael O. |
Hi Mark ! long time no see ;]
|
Mark M. |
how can I help you today?
|
Refael O. |
as always I would like to open by saying thank you so much, your book is probabbly the best thing I bought ever =]
|
Mark M. |
I am glad that it is useful to you
|
Refael O. |
and this office hours feature has been so useful aswell. thanks a lot for your help!
|
Refael O. |
the question for today would be about content provider ;]
|
Mark M. |
you are very welcome
|
Jamshaid A. | has entered the room |
Mark M. |
Refael: what is your ContentProvider question?
|
Mark M. |
(BTW, hello, Jamshaid -- I will be with you shortly!)
|
Refael O. |
View paste
|
Refael O. |
but it always returning false
|
Feb 16 | 9:05 AM |
Mark M. |
I have never tried using that flag
|
Mark M. |
and I do not know exactly what it is about a ContentProvider and notifyChange() that would trigger that flag to be true
|
Refael O. |
hmm, so how would you recommend I would know if it's my own change?
|
Mark M. |
beats me
|
Mark M. |
I'd try to architect your app such that you do not care who makes the cahnge
|
Mark M. |
er, change
|
Mark M. |
IOW, the rest of your app should treat the ContentProvider as if it were from somebody else's app, not yours
|
Mark M. |
and so your own changes are not somehow "different" than changes made by others
|
Mark M. |
BTW, it looks like self-change is if the change was triggered by the ContentObserver, probably with an eye towards avoiding recursion
|
Mark M. |
see the ContentObserver parameter to notifyChange() on ContentResolver
|
Mark M. |
and see deliverSelfNotifications() on ContentObserver
|
Mark M. |
anyway, let me take a question from Jamshaid, and I will be back with you shortly
|
Mark M. |
Jamshaid: your turn! do you have a question?
|
Refael O. |
okie np
|
Jamshaid A. |
yup
|
Jamshaid A. |
was wondering if we have the same server which provides us the services we use in our app
|
Jamshaid A. |
n also do authentication over https
|
Jamshaid A. |
does it make sense to have authorization in this case
|
Feb 16 | 9:10 AM |
Mark M. |
I am sorry, but I do not understand your question
|
Jamshaid A. |
i am somewhat confused ..android has the accounts thing where one can have an authenticator ..enter a username password get a token n use that
|
Jamshaid A. |
but then again there is openIDconnect and oAuth
|
Jamshaid A. |
do i make sense...may be a more simple way to ask would be..whats the best way to go about having authorization and authentication in android app
|
Jamshaid A. |
we have server with https and certificate authority
|
Mark M. |
I have no way of telling you what is 'best'
|
Jamshaid A. |
i mean to say i am confused when i use the accounts and accountauthenticator to setup an account and get a token back
|
Mark M. |
I have not used Android's AccountAuthenticator
|
Jamshaid A. |
smething liek this http://developer.android.com/training/sync-adap...
|
Mark M. |
I know what AccountAuthenticator *is*, I just have not used it, nor have I used SyncAdapter
|
Jamshaid A. |
do u use something else instead for this purpose? i couldnt also find it the book just curious
|
Feb 16 | 9:15 AM |
Mark M. |
I have not attempted to use servers that required authentication or authorization
|
Mark M. |
hence, I have not spent any time on this problem
|
Mark M. |
it is certainly a very valid area of concern, but it is not one where I can provide you with advice
|
Jamshaid A. |
okay .the other thing i wanted to ask was regarding the printer framework.Is it correct understand that one has to always convert whats to be printed to a pdf document
|
Mark M. |
yes
|
Jamshaid A. |
can i send bytes instead
|
Jamshaid A. |
and in the plugin receive bytes?
|
Mark M. |
um, only if the bytes are a PDF document
|
Mark M. |
what plugin?
|
Jamshaid A. |
one can make a plugin for a printer.And then it shows up in the printer services
|
Jamshaid A. |
in the system preferences
|
Mark M. |
I am not aware that the plugin API is part of the Android SDK
|
Jamshaid A. |
i mean that one
|
Mark M. |
if it is, I have not seen it, let alone used it
|
Mark M. |
ah, wait, PrintService
|
Jamshaid A. |
yes :P
|
Mark M. |
well, from a quick scan, on the PrintService side, you seem to get a ParcelFileDescriptor
|
Mark M. |
which means, technically, that could point to anything
|
Mark M. |
I do not recall a way of sending arbitrary data on the client side
|
Mark M. |
and, even if there were a hook for that, no apps would be doing that
|
Feb 16 | 9:20 AM |
Mark M. |
the point of PDF is to establish a common neutral convention for all parties
|
Mark M. |
since we have M apps that want to print and N print services
|
Jamshaid A. |
in printing the standards esc and tsc are used.
|
Jamshaid A. |
but i get what you mean to say and the purprose of having a pdf i will look further into it
|
Jamshaid A. |
there is some source code to make a print plugin in the experimental code branch
|
Mark M. |
if you are implementing a print service that arbitrary other apps can print to, you are going to need to support PDF, because that is what those apps will be sending you
|
Mark M. |
if you are in a situation where you are writing the one-and-only client... perhaps the best answer is to just roll your own thing, and bypass the print framework
|
Mark M. |
let me take another question from Refael, and I will be back with shortly
|
Mark M. |
Refael: your turn! do you have another question?
|
Refael O. |
no Mark that's the only question for today
|
Mark M. |
OK, if you come up with another one, let me know
|
Refael O. |
but I think I figured out something while talking to you
|
Mark M. |
cool!
|
Mark M. |
Jamshaid: back over to you -- do you have another question?
|
Feb 16 | 9:25 AM |
Refael O. |
View paste
|
Jamshaid A. |
have u come across any marketplaces open source other than f droid
|
Mark M. |
no, but I have not gone looking for any
|
Jamshaid A. |
i had questions regarding authorization but other than that i got the book you recommended so i will go through it first
|
Jamshaid A. |
i guess its the questions i had thanks
|
Mark M. |
OK, well, if either of you come up with a question, just chime in
|
Jamshaid A. |
i have a suggestion though or may be u can guide me ... i always find it hard to get the design files like spacing and font sizes
|
Feb 16 | 9:30 AM |
Jamshaid A. |
as i am not designer i was wondering if there be a guide to use the android spacing font sizes
|
Feb 16 | 9:30 AM |
Jamshaid A. |
is there a chapter on this topic in your book maybe i missed?
|
Mark M. |
sorry, but I do not know exactly what "android spacing font sizes" means
|
Jamshaid A. |
like if i want to use a dialog design used by android
|
Jamshaid A. |
in my app so that i dont have to write the themes and styles
|
Mark M. |
:: shrug :: poke around in the Android code, find the implementation, and use it
|
Jamshaid A. |
ok :)
|
Feb 16 | 9:40 AM |
Refael O. | has left the room |
Jamshaid A. |
in android when one swipes from the top we have the settings menu where one can see the settings and turn on wifi bluetooth n so
|
Jamshaid A. |
how is it called
|
Mark M. |
um, I forget the term for that
|
Mark M. |
"quick settings", perhaps
|
Jamshaid A. |
by the way if one were to implement something like that
|
Jamshaid A. |
one should use a framelayout any idea how can one do something liek that
|
Mark M. |
what do you mean by "something like that"? a panel with images?
|
Jamshaid A. |
yeah a sliding panel
|
Mark M. |
oh, you mean the entire notification tray, then
|
Mark M. |
personally, I'd use a library
|
Mark M. |
that being said, the container is whatever you need it to be to lay out the contents
|
Mark M. |
the sliding is just an animation applied to that container
|
Mark M. |
I have an example of it in my one chapter on animations
|
Feb 16 | 9:45 AM |
Jamshaid A. |
i will look at it.
|
Jamshaid A. |
may be also the source code of android has it
|
Jamshaid A. |
but i was not sure of what component it might be part of
|
Jamshaid A. |
n where to look
|
Mark M. |
yeah, I have never gone looking for where that sort of system-wide chrome lives
|
Jamshaid A. |
and multi user support the ability of guest users
|
Jamshaid A. |
is it around from jellybean or was just added in lollipop?
|
Mark M. |
tablets got that in 4.2
|
Mark M. |
phones got it in 5.0
|
Jamshaid A. |
6inch device falls in phone category then
|
Mark M. |
that really depends on the manufacturer
|
Mark M. |
Amazon considers the Fire HD 6 to be a tablet, for example
|
Feb 16 | 9:50 AM |
Jamshaid A. |
it possible to change the system themeing
|
Jamshaid A. |
like to make android 4.4 kitkat looking like android 5.0
|
Mark M. |
not readily
|
Mark M. |
and that would be a firmware thing, which is outside the scope of my expertise
|
Mark M. |
but changing a bunch of apps, plus the system, to adopt a new look is unlikely to be cheap and easy
|
Mark M. |
it's certainly doable, as many manufacturers have created custom "skins"
|
Mark M. |
and rooted devices with the right tools (e.g., Xposed, I think) can do it
|
Jamshaid A. |
okay i will look further but thanks if u come across the authorization and authentication
|
Jamshaid A. |
or some source where it explains it clearly
|
Mark M. |
"it" could be a book in its own right
|
Mark M. |
by which I mean, there are all sorts of possibilities, tied both to client platform and server framework
|
Jamshaid A. |
i mean we have an android device whcih has our app
|
Feb 16 | 9:55 AM |
Jamshaid A. |
and a server for now i use the authenticator as recommended in the course on udacity by google
|
Jamshaid A. |
but nowhere it speaks about authorization and openidconnect
|
Mark M. |
like I said, there are all sorts of possibilities, tied both to client platform and server framework
|
Jamshaid A. |
sorry but i didnt what u mean by all sorts of possibilites in this way
|
Mark M. |
I would imagine that there are dozens of patterns for authentication and authorization, both current and historical
|
Mark M. |
even if you decided to limit the scope to only dealing with authentication and authorization of Web services, there are going to be many patterns
|
Mark M. |
because there are more implementations of that sort of thing than there are people in some small countries
|
Jamshaid A. |
u think there is a good book related to android in particular one can read
|
Mark M. |
I have not gone looking for one
|
Mark M. |
moreover, usually, the server is the one that "dictates the terms" as to what the authentication and authorization will be
|
Feb 16 | 10:00 AM |
Mark M. |
since usually that server has to serve a variety of clients (Web browser, Android app, iOS app, desktop program)
|
Mark M. |
that is a wrap for today's chat
|
Jamshaid A. |
thanks
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Thursday at 7:30pm US Eastern
|
Mark M. |
have a pleasant day!
|
Jamshaid A. | has left the room |
Mark M. | turned off guest access |