Office Hours — Today, March 25

Tuesday, March 23

Mar 25
9:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
10:00 AM
Sebastian
has entered the room
Mark M.
howdy!
Sebastian
good morning Mark
Rick J.
has entered the room
Mark M.
howdy, Rick!
Rick J.
Good Morning
Sebastian
i wanted to follow up on the alarmmanager, where i said it wasn't firing on 2.0 devices. that was not correct. there was a bug in my code. on that particular device/user he would get time changes updates every minute, so i would push the alarm time front of me, since i would reschedule the alarm on a time change
Rick J.
OK to ask my question now?
(after Sebastian)
Mark M.
Sebastian: OK
Sebastian: ummm...is there a question related to this? or is it just purely a followup?
Sebastian
what i will say though there are some oddities with the alarmmanager, but i am not 100% certain yet. e.g. it's 5pm and i have an alarm at 6pm. then i set manually the time to 5:59. i would expect the alarmmanager fire at 6pm. but it didn't as i expected... i still have to verifiy this one more time though... that's it
just follow-up... i ask a totally different question after Rick...
if i may :-)
Rick J.
Go ahead, you were first
Mark M.
yeah, I haven't played around with manually fussing with the time
Burt B.
has entered the room
Mark M.
eminently possible there are edge/corner cases in there where AlarmManager may get confused
howdy, Burt!
Sebastian: I guess it's still your turn -- ask away
Burt B.
Hi, Just really getting started with Android development, so just kind of lurking this morning. I'm sure I'll have some questions over time.
Rick J.
OK
10:05 AM
Rick J.
Mark, I would like to use the SD card to store secure apps
Mark M.
Rick: that does not sound pleasant
Rick J.
You can't normally run apps from the SD card, correct?
Mark M.
:-)
Rick J.
:)
Mark M.
correct
only with Cyanogen or related mods
and that's only if you don't care about security
Rick J.
So, I'm wondering if there is a way to be creative about it
What is Cyanogen?
Mark M.
Alternative firmware
Rick J.
ah
Mark M.
he has apps-on-SD baked in, from his own implementation
Rick J.
Could the app information be stored in something like a library?
Mark M.
works, but not secure
there is nothing really secure about SD, period
Rick J.
that could be loaded dynamically from an app?
well, we might make it secure
Mark M.
so, loading a JAR or something off the SD card is asking for trouble
that's not strictly possible
Rick J.
Can you elaborate?
Mark M.
name any DRM solution that has survived the wild
if the user has the device, and the device has your code, the user can get at your code
there's nothing you can really do about that
SD is worse, in that it is trivially easy to replace stuff there
Rick J.
I can't really go into details
but, say we could do something at the hardware level?
Any creative ways of accessing that data as an app?
Mark M.
at the hardware level, you probably don't even need to rely on the SD card
what "that data"?
Rick J.
in this case the app
Mark M.
sorry, I'm seriously lost
10:10 AM
Rick J.
If an adb file is stored on the SD card
10:10 AM
Mark M.
do you mean APK file?
Rick J.
can you programattically install it onto the Android machine?
sorry, yes
(understanding that it isn't secure while it is installed)
Mark M.
you can initiate an install
the user still need to approve the install
Rick J.
OK
and it would be possible to store jars on the SD card which are accessed at run time
Mark M.
same sort of screens (e.g., permission confirmation) as if you loaded it off the Web
Dan S.
has entered the room
Rick J.
OK
Mark M.
yes, if you're not concerned about security
rephrase that
yes, if the JARs hold dex bytecode, and if you can get the classloaders to play ball
Rick J.
OK, thanks
Mark M.
haven't tried this, but reportedly it works
howdy, Dan!
Dan S.
Hi there
Rick J.
Do you remember a pointer to where you read this is possible?
in case there is more I can read up on it?
Mark M.
Look up DexFile and such in the SDK, then look for posts from fadden on [android-developers] related to those classes
Rick J.
Thanks again...passing the baton to whoever is next...
Mark M.
Sebastian: did you have a question?
Sebastian
my question is about updating a list whith a cursoradapter and a contentprovider. let's say the list display a name and a checkbox. when the user checks/unchecks the box i update the contentprovider with update(). now the cursor still has the old data in so if if scroll the row off/onto the screen bindView() will be called and i populate the list with the now old cursor. now i guess i could call requery() on the cursor but that seems slow and least from my tests i did ( user could have 100s of rows) so requering for a simple checkbox change seems costly.
Mark M.
not surprising
Sebastian
i guess i could just cache the checkbox state and don't use the cursor
Mark M.
depends on what you're updating, I suppose
is this one of the Android built-in ContentProviders?
10:15 AM
Sebastian
it's my own
Mark M.
are you implementing more than one app?
in other words, is this ContentProvider designed to share data between apps?
Sebastian
not *really* needed since it's only used within our app. but for the sake of trying it out we did a contentprovider
Mark M.
yeah, well...
Sebastian
seems like that's biting me now in the...
Mark M.
ContentProvider performance leaves something to be desired
it's designed for cross-process work
lotsa overhead, needed for cross-process work, not needed for intra-process stuff
things *may* be faster if you switch to directly hitting SQLite
Dan S.
View paste
I know that the Android best practices specify that an app should not "exit"...but I am trying to implement that behavior. I have a menu with an Exit option but it does not always seem to work...I call finish() and the behavior is not consistent. Here is the code:
oops ..did not mean to do that until Sebastian was done ....
Mark M.
Sebastian: in short, I'm not really sure how to answer your question definitively
Sebastian
thank you... i might rethink the design... android-dev was a strong proponent of the contentprovider even if it's just itnernal within your app
so it's all their fault :-)
10:20 AM
Mark M.
no, I definitely can't recommend ContentProviders for internal-to-app use, any more than I can recommend AIDL for local services
Sebastian
thanks for input
Mark M.
Dan: you're up now
Dan S.
ok thanks...try to get my app to consistently exit.
did my earlier errant post with my question and code snip come through?
Mark M.
question, yes; code, no
Dan S.
View paste (6 more lines)
            case R.id.exit:

                //Log.v(TAG, "Exit button hit - before alert box");

                adExit = new AlertDialog.Builder(this);
                adExit.setTitle ("Exiting My Locker Number");
                adExit.setMessage(R.string.exittext);
                adExit.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        Log.v(TAG,"in the onClick");
                        final NotificationManager mgr=(NotificationManager)getSystemService (NOTIFICATION_SERVICE);
                        Log.v(TAG, "canceling the notify activity");
                        mgr.cancel(NOTIFY_ME_ID);
                        Log.v(TAG,"calling finish");
                        finish();
...
Mark M.
OK
what specifically is the problem?
Dan S.
it work when I test on my device when tethered and running the app with eclipse
but when I test with the app running on the phone the exit does not always seem to work
Mark M.
meaning, nothing happens?
10:25 AM
Dan S.
the behavior is that I will hit the exit button. Then the dialog shows. I hit OK on the dialog and then the app shows up again
Mark M.
"app shows up again" -- meaning it feels like it finish()-es but restarts, or does the dialog just go away like normal?
Dan S.
correct...the dialog goes away, but the app still shows up
Mark M.
You might try calling finish() inside of a Runnable that you use with post() or postDelayed()
basically, get it so it is *triggered* by the dialog, but does not run in the dialog's onClickListener
Dan S.
ok...I have not heard of post()...how does that fit in the lifecycle?
Mark M.
post() and postDelayed() are methods on Handler and View
they schedule a Runnable to be invoked by the main application thread
10:30 AM
Mark M.
post() will have the Runnable run after any other events presently in the main application thread's message queue
postDelayed() adds a delay on that, expressed in milliseconds
Dan S.
ok. looks like I need to do some reading...I will try that-thanks!
Mark M.
anybody else have any questions?
Rick J.
Yes
Burt B.
Not today, but after some reading and working on a couple of ideas I'm sure I'll have some in the near future :)
Mark M.
Rick: go ahead
Dan S.
has left the room
Mark M.
Burt: sounds good!
Rick J.
I read some old forums that suggest that Google is working on allowing you to run apps from an SD card, but haven't seen anything recently
do you know if there is any truth to this?
Mark M.
the most formal statement on this effect was a hint dropped by Andy Rubin at the Nexus One launch
and that wasn't terribly definitive
as you're probably aware, the core Android team is fairly close-mouthed on future features
10:35 AM
Rick J.
Also, what makes the SDCard more vulnerable than, say, the internal NVRAM?
Mark M.
hence, we won't know much about apps-on-SD "for realz" until it shows up one day
Rick J.
:)
Mark M.
1. SD card can be ejected and is read/write to anything you plug it into
2. SD card is read/write to all processes on the device itself
contrast that to your app-local files (getFilesDir()), which is read-write to you and root, but deny-all to everyone else
courtesy of Linux and having a real filesystem
so, data in your app-local file store can still be gotten to by users who root their phones, but is otherwise fairly safe
Rick J.
OK, thanks
10:40 AM
Sebastian
one more general question. i didn't really read anything about it, please execuse if it's obvious... can i do (easily) animations between activities? e.g. i have my list view activity and if the user clicks a row i would like to slide in the details-view activity from the right. like iphone-ish with their table controllers.
Mark M.
starting with 1.6 or 2.0, there's a way you can specify what the inter-activity animation is
whether or not they are enabled, though, is up to the user
and, off the top of my head, I forget exactly where you specify those animations
Sebastian
i see. thanks
That's it for me. time to leave the campfire and go back to my desk... have a good day everyone!
Mark M.
you too!
Sebastian
has left the room
Mark M.
anybody else have a question?
10:45 AM
Rick J.
I'm all set, thanks
Burt B.
I'll try to have some questions next time :) Thanks..
Rick J.
has left the room
Burt B.
has left the room
10:50 AM
Mark M.
turned off guest access

Tuesday, March 23

 

Office Hours

People in this transcript

  • Burt Bicksler
  • Dan S.
  • Mark Murphy
  • Rick Jones
  • Sebastian