Mar 23 | 7:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Mar 23 | 8:00 PM |
Jonathan | has entered the room |
Mark M. |
howdy!
|
Jonathan |
Hello Mark!
|
Jonathan |
I have an app that has quite a bit of audio content
|
Jonathan |
I plan on deploying the audio to the sdcard by downloading from the net
|
Mark M. |
OK
|
Jonathan |
but I want to encrypt it on the card and decrypt it in the app before playback
|
Jonathan |
(it would come from the net encrypted)
|
Jonathan |
how do I do this securely? If I store the key in the program, can it be obtained by examining the apk file?
|
Mark M. |
yes
|
Mark M. |
basically, you're trying to do DRM
|
Jonathan |
yup
|
Mark M. |
that's the sort of thing that really big businesses try to do...and they get hacked quickly
|
Jonathan |
haha
|
Mark M. |
so, I don't know of a solution here
|
Jonathan |
Okey doke.
|
Mar 23 | 8:05 PM |
Mark M. |
sorry
|
Jonathan |
No worries. I thought it might be like that...
|
Mar 23 | 8:10 PM |
Jonathan |
Thanks
for your help. I'm going to look through my notes and see if I can boil
down my other issues into some questions before office hours are over.
:)
|
Mark M. |
ok
|
Mar 23 | 8:25 PM |
Jonathan |
I
spent quite a bit of time wrestling with the MediaPlayer and getting
into trouble with making calls to the MediaPlayer in the wrong state. I
admit that most of my problems come from the fact that I have not yet
implemented all the Listeners for the MediaPlayer to keep track of
state.
|
Jonathan |
Do you have any advice on how to handle a MediaPlayer which will play multiple clips from a loop within an AsyncTask?
|
Mark M. |
Um
|
Mark M. |
the clips are sequential?
|
Jonathan |
Yes, sequential.
|
Jonathan |
I call play, then sleep the AsyncTask
|
Mark M. |
the completion listener should cover it, then
|
Mark M. |
ick
|
Mark M. |
not a big fan of sleep()
|
Mark M. |
Have AsyncTask kick off the first clip
|
Jonathan |
:) What would you reccomend?
|
Mark M. |
have the completion listener kick off the next cliip
|
Mark M. |
er, clip
|
Mark M. |
only have the AsyncTask start your playback chain -- let each clip's completion start up the next
|
Mar 23 | 8:30 PM |
Jonathan |
AsyncTask is iterating through several of these playback groups
|
Jonathan |
hence the sleep.
|
Mark M. |
I don't see why that matters
|
Mark M. |
whether is is two clips or 20, they're all in sequence, right?
|
Jonathan |
I'm thinking...
|
Jonathan |
slowly.... :)
|
Mark M. |
I figured you were on dialup... :-)
|
Jonathan |
LOL
|
Mar 23 | 8:35 PM |
Jonathan |
It's a yoga app
|
Jonathan |
playing audio per pose
|
Jonathan |
with various ammounts of time per pose
|
Mark M. |
ok
|
Jonathan |
defined by the user.
|
Jonathan |
so sometimes all we can do is say the nae before it's time to transition to the next pose
|
Mark M. |
"say the nae"?
|
Mark M. |
is this is Scottish yoga app?
|
Jonathan |
name
|
Jonathan |
haha
|
Jonathan |
other times we have more time available to give pointers or goals for the pose. intructions,if you will
|
Mark M. |
ok
|
Mark M. |
user queues up a set of positions and goes through them?
|
Jonathan |
It's nice to have some silence too. :)
|
Mark M. |
s/positions/poses/
|
Jonathan |
yes
|
Mark M. |
ok, here's how I'd do it
|
Jonathan |
with times per pose
|
Mark M. |
Step #1: In the activity, when the user says "start", you do two things
|
Mark M. |
Step #1a: you start playing back the first clip in the set for this pose
|
Mark M. |
Step #1b: you call postDelayed() on a Handler or View to be notified when the user's chosen time for the pose ends
|
Mark M. |
Step #2: in the completion listener for the MediaPlayer, if there are more clips in this set, start the next clip
|
Mark M. |
Step
#3: in the Runnable you passed to postDelayed(), you stop and reset the
MediaPlayer, kick off the clip for the 2nd pose, and postDelayed() the
Runnable for the 2nd pose's time
|
Mark M. |
Step #4: lather, rinse, repeat
|
Mark M. |
no AsyncTask, no sleep()
|
Mar 23 | 8:40 PM |
Jonathan |
OK.
|
Jonathan |
We stop the MediaPlayer in the postDelayed() Runnable in case we've played the audio past our poses time limit, yes?
|
Mark M. |
yes
|
Mark M. |
this way, the audio ends either when you run out of clips for the pose, or the pose's user-set time ends, whichever comes first
|
Jonathan |
Okey dokey. I'll mull this over.
|
Jonathan |
yes
|
Jonathan |
Great, thanks again!
|
Mark M. |
happy to help
|
Mar 23 | 8:45 PM |
Jonathan |
I
have to tell you that I just recently bought my subscription and it was
these office hours that convinced me. What a great idea!!
|
Mark M. |
I just keep trying to add value
|
Mark M. |
which reminds me, the next edition of the Advanced Android book rolls out tomorrow, barring unforeseen problems
|
Jonathan |
That and the fact that almost every time I search for something android related you're the one giving the solution. :)
|
Jonathan |
ooh, great!
|
Jonathan |
OK, I have lots to re-write now, so I'll say goodbye. :) Have a great night!
|
Mark M. |
you too
|
Mar 23 | 8:50 PM |
Jonathan | has left the room |
Mark M. | turned off guest access |