Office Hours — Today, February 11

Yesterday, February 10

Feb 11
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:05 AM
Jamshaid A.
has entered the room
Mark M.
hello, Jamshaid!
how can I help you today?
Jamshaid A.
hello
i wanted to ask you regarding schedullling time on and off for android.
is it possible i came across an android tablet that has this setting
u can set a fix time for turning on the tablet and a fix time to turn the tablet off
but i looked around alarmmanager is it possible do something like this , if ever u came across i was wondering i ask
Mark M.
you cannot turn a device on or off from an ordinary Android SDK app
you cannot hold the permissions to do this
and, if the device is truly powered off, it cannot be powered on automatically, any more than it could if the battery were removed
9:10 AM
Jamshaid A.
is there a way i can find a list of system permissions across android
as i work on a system app i was wondering if its possible
Mark M.
if by "system permissions", you mean permissions with a protectionLevel of "system", the best place is in the manifest for the version of Android that you are working on
that links to the master branch of the manifest defining permissions
you might want to choose a different tag to constrain to the particular version of Android your app ships on
Jamshaid A.
i use android 4.4 , and shareuserid= system n the app is signed with system signature
is it the same as protectionlevel system
and could you point me where i could learn more about the security architecture n the permission system of android
Mark M.
there is a separate protectionLevel for "signature"
though you will find some permissions with a protectionLevel of "signature|system", at least on Android 5.1 and below
9:15 AM
Mark M.
I do not know how sharedUserId affects permissions, as that's not used much outside of scenarios like yours, so I have no real experience with it
Jamshaid A.
have u come across documentation where i could learn more about this
Mark M.
you might try books on Android internals
Karim Yaghmour's book might get into it
Jamshaid A.
thanks i will check it out :)
i m going through how the content provider abstraction works in android in general .Though i still have to go through your chapter of content provider.now the oppertunity si there so i was wondering
do u think is the best approach to share data with toher apps
9:20 AM
Mark M.
that depends on the structure of the data
if the data looks like database entries (rows and columns), or the data looks like a stream of bytes, then yes
Jamshaid A.
more like rows and colums
Mark M.
then a ContentProvider is probably a good choice
you could attempt to offer an API through an AIDL-defined service binding
on the plus side, you get a lot more control over exactly the structure of what gets published to other apps
however, it is more work, both for the client side and the service side
Jamshaid A.
for now we just add some hardware to android tablet over bluetooth .so instead of home app replace the launcher app with ours
n have our own update system no google
so i figured one can have a launcher app that makes sure all the connected harware is working over belutooth or wifi
n then have a seperate user app that gets launched
n regsiter to events to the launcher app
9:25 AM
Jamshaid A.
so there is no invovlement of someone else developing for the launcher app.so i guess great control over the structure of published to other apps is not really required as we build the system n dont include third party
Mark M.
while we typically use "third-party" to refer to other firms, in a large organization, "third-party" might refer to other teams within the same firm
Jamshaid A.
thanks for the correction in this context i meant outside the firm.And considering its a small team i didnt think but like you shared it might be good decision for future
Mark M.
while you may have greater opportunities for coordination with those teams (e.g., permissions), you still may wish to think in terms of APIs and contracts for how apps from one team interact with apps from another team
Jamshaid A.
if i understand correctly
Mark M.
yes, in that case, use whatever makes you comfortable, on the whole
Jamshaid A.
by the way to your knowledge how could something like powering on a device at schedulled time be even possible...
is there a system clock one can register with n that invokes and starts up the system
Mark M.
again, technically, that's not possible
you might be able to move a device from a very deep sleep into an "on" state
but to me, "off" is no different than if the battery were removed
and you cannot go automatically from "off" to "on"
beyond that, none of this is possible at the Android SDK level, though I am sure there are options for this in custom firmware
however, that is beyond my areas of expertise
9:30 AM
Jamshaid A.
i have asked the OEM who put the app inside the tablet ..its in the settings panel.. i will inquire with them
another thing apart from the google IO app
which other opensource apps you think are a good idea to look over for general apps design ?
good design i mean
Mark M.
sorry, but I do not have any recommendations to make in that area
Jamshaid A.
another long shot and the last inquiry i saw your talk on having plugins
but then i havent gone through dashclock source code yet .but what i was wondering about if it were possible to add UI elements for instance ... the navigation drawer where a new plugin once added is shown in the navigation drawerlist
Mark M.
having an entry in a navigation drawer based on plugins is certainly possible
Jamshaid A.
i hope i make sense with my inquiry do i ?
Mark M.
the key is that you cannot readily blend UIs from multiple apps together
to put it in Web terms, there is no <iframe> equivalent in Android, to allow you to embed another app's UI in your own
that means that tapping on the navigation drawer entry could lead to an activity supplied by a plugin, but you are jumping to a completely different activity
9:35 AM
Mark M.
whereas for other entries in your navigation drawer, perhaps you are swapping around fragments
9:35 AM
Mark M.
so, getting a consistent UI flow may be difficult
Jamshaid A.
so adding fragments would not be possible as plugins ?
Mark M.
correct
you cannot pass a fragment through any sort of IPC mechanism
while the host app could load resources from the plugin, it cannot readily load code from the plugin
now, in your particular case, because you have complete control over your environment, you may have more options
I tend to write for ordinary Android SDK app developers, not developers working on custom firmware or hardware
and I have not thought about plugins in your sort of situation
Jamshaid A.
tahnks but u helped alot.I was just thinking that rather then updating the app make one app with navigation drawer.as different customers from us want different services.they can use those services as plugings .But still have a consistent simple UI which i can control
how its designed. the idea is to have dedicated simple consistent experience but only those services are installed as plugins based on user choice.navigation drawer seemed like a simple UI for this purpose
9:40 AM
Jamshaid A.
as i figured developing now with limited resources a navigation system might get complex n confusing as ppl have familiary with navigation drawer
Mark M.
you are certainly welcome to experiment with it
Jamshaid A.
thanks i wil.i guess thats all i have to ask for today.i will get the book n go over it.Have a goodday greetings from germany
Mark M.
OK, have a pleasant day!
Jamshaid A.
has left the room
9:45 AM
Nikhil
has entered the room
Nikhil
Hello Mark sir
Mark M.
hello, Nikhil!
how can I help you today?
Nikhil
Quick question - If I change minsdkverion in Gradle file only and not in manifest will it work ?
Mark M.
yes
for values that can exist in both places, the value in Gradle will be used, overriding what is in the manifest
now, you might get a build error, if your minSdkVersion is lower than one requested by
er, requested by a library
Nikhil
ok
9:50 AM
Nikhil
and I am on ActiobarNative chapter, in that it I started a new project and by default AppCompact is extended . Do I have to remove Appcompact from root to work with ActionBArnative
Mark M.
you would need to have your activity not inherit from AppCompatActivity
and you would need to have that activity's theme in the manifest not inherit from Theme.AppCompat
and, if you have an existing menu resource (e.g., set up by a new-project wizard), things like app:showAsAction would change to android:showAsAction
Nikhil
ok thanks
Mark M.
at that point, you should be able to remove the appcompat-v7 dependency from your build.gradle file
Nikhil
yes I did all that , had to confirm from you that all that is necessary
thank you
that's all from my side
Mark M.
OK
10:00 AM
Mark M.
that's a wrap for today's chat
the transcript will be posted to https://commonsware.com/office-hours/ shortly
the next chat is Tuesday, at 9am US Eastern
have a pleasant day!
Nikhil
has left the room
Mark M.
turned off guest access

Yesterday, February 10

 

Office Hours

People in this transcript

  • Jamshaid Ali
  • Mark Murphy
  • Nikhil