Office Hours — Today, November 17

Saturday, November 14

Nov 17
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:00 AM
Refael O.
has entered the room
Mark M.
hello, Refael!
how can I help you today?
Refael O.
Hi Mark
been a while since last time i've been here :)
ok, i have 2 questions please
Mark M.
go ahead with the first one
Refael O.
i am currently developing a new smartwatch.
now, one of my apps is a system app on this watch
and it's running 24/7
my problem is :
i have a location manager, and currently i am using "requestLocationUpdates" method with LocationManager.NETWORK_PROVIDER
i am taking a sample every 60 sec
now, I want to change to Passive, to save battery
View paste
how would you recommend to do that?
I notice if I change to Passive I am losing my every 60 sec location rate
9:05 AM
Refael O.
since passive only provide a sample if another app uses gps
or network
Mark M.
I guess I don't understand the question
you can't have "every 60 seconds" *and* passive
for the reasons that you cited
Refael O.
View paste
basically, I want to get locations constantly with the least usage of battery consumptions. 
and I am struggling with how to do that.
Mark M.
um, well, to be honest, implementing an Android SDK app to do this, running 24x7, would be bad on a phone or tablet
on a smartwatch, it would seem to be "a non-starter"
why is this an SDK app in the first place?
Yaniv
has entered the room
Mark M.
if it's part of the system, and it's supposed to run 24x7, why isn't this some Linux daemon
where you can more tightly bind yourself to the core OS bits that handle location services
and perhaps come up with some solution that further minimizes battery ?
(BTW, hello, Yaniv -- I will be with you shortly!)
Yaniv
thanks
Refael O.
didn't thought about this like that, since i have zero experience in developing it
9:10 AM
Mark M.
developing for a smartwatch is closer to embedded systems engineering than even developing for a low-end phone, just due to the battery size
Refael O.
our battery size is 800mAh..
Mark M.
most developers have no choice but to work at the SDK level, because they aren't creating smartwatch firmware
Refael O.
still pretty lowish, but higher then most watches
Mark M.
however, you *are* creating smartwatch firmware
Refael O.
yeah, ok i'll have to check out this option if you say so
okie, take a question from Yaniv while i write my 2nd question.
Mark M.
OK
Yaniv: your turn! do you have a question?
Yaniv
Hi
I have an android device that I would like it to be in the car
and when phones bind to it with bluetooth
I want it to pull certain data from the phones like their current battery status
contact list
their signal strength
etc
I have no idea how to do that since the android api's for bluetooth don't mention this type of client-server relatioship
I have seen bluetooth profiles implemented in java
open source stuff like bluecove
but I don't know how to do that in android as weel
well
Mark M.
my knowledge of Android's Bluetooth APIs can fit on the back of a postage stamp
9:15 AM
Mark M.
there should already be a Bluetooth profile for the contact list
as that is used by hands-free dialing
Yaniv
there is
Mark M.
with respect to the rest, my assumption is that you would need to have a Bluetooth service exposed on the device that the car can call into
whether that uses RFCOMM or some custom Bluetooth profile is beyond my experience
I am not aware of battery status and signal strength being exposed by any conventional Bluetooth protocol, though I cannot rule it out
again, I have very little Bluetooth experience
heck, I'm happy when I can get Bluetooth working as a *user* :-)
Yaniv
I see
ok well , thanks anyway
Mark M.
sorry I could not be of greater assistance
let me take a question from Refael, and I will be back with you in a bit
Yaniv
no worries
Mark M.
Refael: your turn! do you have another question?
Yaniv
I don't have any other questions
Refael O.
Yeah
OK
Yaniv
has left the room
Refael O.
I have an image, and I want to take the top 50% of it's height, and blur it + write some text on the blur.
what way should i use to achieve that?
for the blurring i mean, do i need to cut the bitmap in half?
Mark M.
um, well, that would depend a bit on how you want to do the blur
um, well, that would depend a bit on how you want to do the blur :-)
9:20 AM
Mark M.
I can see three main options for doing a blur effect:
Refael O.
can you explain? :P
Mark M.
1. actually blur the image itself
2. apply some sort of blur effect while rendering the unblurred image
3. have some overlay on top of the image on the Z axis that, through translucency, is providing the blur effect
Refael O.
ok, which of this options would you recommend?
Mark M.
is the blur+text a permanent condition of the image? or is it an artifact of something you want to display, but the image itself should remain untouched?
Refael O.
hmm
View paste
it's in the header of my listview, i have a big image of a business deal + text (price of the deal).
that deal may change every time you enter the app.
Mark M.
but the price and the image are tied together and tied to the deal?
Refael O.
i guess they are, every deal has a different price and image
Mark M.
then the simplest programming solution is: have the graphic designer give you the image with the blur and text applied
is there a reason why you would need the unblurred/un-overwritten image?
9:25 AM
Refael O.
aw now i see where you went with that question hehe
i wish I could do that
but there's a million picture possibilies
i get the image url in a json
Mark M.
well, your graphic designer is already preparing the million pictures, right?
Refael O.
and every business owner can upload his own picture
they don't go threw my designer
Mark M.
then apply the blur and text on the server, where the image gets uploaded
Refael O.
thru**
Mark M.
general rule: never do on a mobile device what can be done more efficiently elsewhere, such as on the server
Refael O.
can it be done on the server?
Mark M.
sure
people have been doing that for a long, long time
ImageMagick and kin
do you think all those meme PNGs (e.g., I CAN HAZ ...) are hand-generated by elves?
:-)
Refael O.
hehe
k i'll get up from my chair and have a talk with my backend developer ;]
thanks a lot Mark
Mark M.
happy to be useful!
Refael O.
have a good day!
Mark M.
you too!
9:50 AM
Refael O.
has left the room
9:55 AM
Mark M.
turned off guest access

Saturday, November 14

 

Office Hours

People in this transcript

  • Mark Murphy
  • Refael Ozeri
  • Yaniv