« first day (1329 days earlier)      last day (2146 days later) » 

7:00 PM
But when the activity and the fragment is not visible the service stops ? :)
 
and you checked it by profiling it?
 
and in long run the simple becomes too much trouble
@RaajaSN i have a music player
 
@WeirdNerd no it will be destroyed when you call unbindService()
 
since 2 years
i have tried all
bounded
aidl
start
and whatnot
 
@RaajaSN I did not call unbind() at all so how did it stop ?
 
7:01 PM
so i know what is fast and what is not
 
@WeirdNerd if you use startservice you have to stop it
if you only call bind then on unbind it will be destroyed
 
when some one click on stop button
 
I guess you can tell more by looking at my code.. Since you also have some work no issues I will contact you tomo @ 11
 
You might have called unbindService in onDestroy() or onStop() of your activity @WeirdNerd
 
7:04 PM
Nope never did ..removed that code but still had that issue
I am sorry I removed that code after you said
Sorry sorry
 
service leak connection ?
 
Yes
 
Hey everyone.
 
Exactly
@TheNightKing Correct !
 
any one here have experience developing cloud app in java with android frontend ?
 
7:05 PM
@WeirdNerd well that happen when you do that
 
@ankitagrawal which is the slowest?
 
@TheNightKing You mean when I removed the code ?
 
@WeirdNerd yes
 
Is Cloud Endpoints the best service to use if you want to post a marker on GoogleMaps so that other users (that use your app) can see it?
 
start service @RaajaSN
 
7:06 PM
@TheNightKing Ok let me stop the service by including that method
 
what about AIDL ?
 
@WeirdNerd then it will stop your music player
 
@ankitagrawal
 
it is fast
 
Ok Let I will include a button and only on the press of it the unbind will be called
Let me try
 
7:07 PM
but bounded without aidl is faster
 
@ankitagrawal in what ways it is slower ?
 
since its in single process
@TheNightKing speed
 
@ankitagrawal what speed did you check the method calling speed ?
 
AIDL is slower than all
 
7:09 PM
the whole process speed
 
IPC is slower
 
it think both same run has same thread
 
ipc is slower definitely
but not slower than startservice
 
you are talking process which process ?
 
IPC runs on BinderThread
Maybe you are correct.
 
7:11 PM
which process it make slower ?
 
yes i am correct becoz i have tested that @RaajaSN
my app has 2 years of my research
 
which process ?
 
we are talking approaches
@TheNightKing??/
 
you said process is slow
what approach !
 
As i have known bind service bounds the service to the componant? it will be quick instead of starting a service for every user event. But is it really noticable
 
7:12 PM
@RaajaSN yes it is
 
I don't underestimate your research by the way... :)
I haven't noticed such a delay
 
i definitely was able to notice that
 
maybe your app has pointed it very well
 
when you make full fledge player which has 1000 of condition to handle
and many other options
 
how muchh time take ServiceConnection to bind the service ?
 
7:14 PM
its starts to become noticable
@TheNightKing depends on device
 
@TheNightKing you can find using systrace
 
on my lg g4
1 sec max
 
and how much time it take onStartCommand to execute
 
less than 1 sec
lg g2
 
@RaajaSN please find for me
@ankitagrawal that is also one process right ?
 
7:15 PM
but onStartcommand need to be executed veryOften
 
@TheNightKing what you mean
 
you said process is slow
 
so the bind service is good choice with such a huge app
 
@TheNightKing currently i am using aidl
@TheNightKing no
process is not slow
@RaajaSN btw a point you missed
why it is slower
when we pass extras
startservice tend to get slower
 
@ankitagrawal yes it need to parse the intent
 
7:17 PM
than aidl and bounded
so that slower and slower
with many extras
 
if you send a lot of startservice call i agree with you...
 
19 mins ago, by ankit agrawal
i have tried startservice
19 mins ago, by ankit agrawal
too much work and too slow
 
see that is why i told you bounded are better
@TheNightKing what?
@TheNightKing try using that calls in a realtime app
you will know the difference
 
what is slow in that
 
Android is always a wonderful Framework, for simple app there is an option to start a service without noticeable performance impact. the same when you use more number of times it is impacts performance. And android has another option as bound services... This proves it.. How sweet @ankitagrawal
 
7:20 PM
it is slower than bounded
when you use more number of times it is impacts performance. And android has another option as bound services
 
i will find it... but i need some time... I will report you how long does it take to make a service connection @TheNightKing
 
@RaajaSN see
i am right
 
@ankitagrawal why we use bind service ?
 
when we want to connect activity to service
 
@TheNightKing to bind things
:P
 
7:22 PM
and basically to connect to UI
 
@ankitagrawal i know that but i thought about a simple app.. i don't know how much events you send to your service.
 
this close the debate then
 
100%
 
@ankitagrawal then why not BR
 
:)
 
7:22 PM
ANkit is a person with a tremendous experience
 
@ItachiUchiha :D
 
@RaajaSN ddont ask me too many
 
you communicate with that also
 
even a single song playing will
trigger atleast 7 broadcast
6 image loading
1 blurring
 
You are my guru
 
7:24 PM
and many other data binding
 
@ankitagrawal no i am not asking how much events. I am just saying that i don't know that you send that many events into your service. If there is many number of calls then bindservice is worth it.
tthats why i stated its a simple approach
 
@RaajaSN
@RaajaSN i see your point
but binded service are mmade for thi
s
so we should things that are made for this
 
Good one
 
but you did not tell me what makes it slow ?
 
why go through all the trouble
@TheNightKing checking if service is already started
putting bundles
and calling proper onstartcommands method
with new data
 
7:27 PM
you can use different action
 
all these things happened
 
@TheNightKing basically the onStartCommand is expensive... if you have lot of restart behaviour
 
onSingleProcess you do that with activity
 
but that still not reduce that cost
 
that mean startActivity is also slow :p
 
7:28 PM
binding is expensive too but once bound it is bound.. you are free to call methods inside Service.
 
it is that is why fragments very born
@RaajaSN that is one time cost
 
no need to parse the intent very often
@ankitagrawal thats what i am point to him
 
and worth the effort
 
@RaajaSN but it's bind with component
and anything happen it will leak
 
it wont leak
 
7:29 PM
no no.. thats the reason you need to call unbind service at the right places...
 
ondestroy it unbinds
 
or even you can unbind from Notifications.
 
anyways i can put this debate to rest with one point
you all forgot and me too
 
@ankitagrawal i am aware of that point... :)
 
@ItachiUchiha o/
 
7:30 PM
@ankitagrawal then why that happen with weird nerd
 
@RaajaSN ok then i am sleeping
 
@TheNightKing I would like to give you one tip..
 
@TheNightKing what happened with him?
 
@ankitagrawal o/
 
@RaajaSN i don't need
 
7:31 PM
lol
 
fine :)
 
@ankitagrawal service connection leak
ask him
 
never happened with me
it is his mistake
 
I did not call unbind
 
see ^^
 
7:32 PM
and hence the service connection leak
 
@TheNightKing ^^
 
but when he call the unbind service music player wont play in background
 
no
who said it wont play
it will play
 
how ?
 
It happened it did not play
Really
 
7:33 PM
that is not how bounded service works
if you start then bounded
 
That's when the debate between me and Raajan started :)
 
@WeirdNerd if you want to play the music in the background. Just show a notification. and once the notification is clicked call unbind service in your activity. It would be the best approach
 
then it wont stop
if you only bound
 
but service leak will happen
 
then it will stop
@TheNightKing no it wont
 
7:34 PM
because it is bind with component
 
service wont leak.... it will be stopped
 
@RaajaSN Oh so without the notification the service will end ?
 
@WeirdNerd no that is also not true
ui is unbounded
 
no it won't I will give the general idea.
 
7:35 PM
service wont stop period
 
it will only be destroyed when you call unbindService()
sorry stopped
 
service will keep running as long as you dont stop it
 
Ok give me a few mins let me run the code again
 
it is upto you to call wherever you want
 
I have called it inside a fragment
 
7:36 PM
@WeirdNerd
 
Why does the gradle build take so much of time ? Any idea ?
Yes tell me Ankit
 
which version of Studio you use?
 
2.1.2
The latest
 
@ankitagrawal then why service leak
 
do you use the one with instant run? Also the first build will take time even if you use instant run..
 
7:38 PM
becoz he didnt unbind
@TheNightKing
 
@RaajaSN Yes..
 
yeah question again if he is unbind the service then music player stop
 
Let me just confirm that again
 
no that is not how it works
 
i just gave you a best approach for your scenario just call the unbind service in your activity when the notification is clicked. @WeirdNerd
 
7:39 PM
@RaajaSN OK thanks a lot !
 
@WeirdNerd you see my player
 
Yes I have installed your app
 
did the song stopped when you quit my activity
 
Nope never
 
so ......
 
7:40 PM
you are binding service with which component ?
 
period
i am using
bounded service
activity @TheNightKing
 
@WeirdNerd @ankitagrawal i don't want to cross your discussion. in you gradle.properties file add this line org.gradle.jvmargs=-Xmx2048m
instant run requires 2GB of memory
 
lol i am sleeping bye
 
@ankitagrawal which app is that
?
 
I am having 8GB of RAM
 
7:41 PM
@WeirdNerd
@TheNightKing
 
Bye.. Take Care...I will ping you tomo
 
@TheNightKing ???
@RaajaSN
 
@ankitagrawal your music
app
 
poweramp is best player he used ndk
i am using sdk
 
what is name of that
 
7:43 PM
@ankitagrawal He is using NDK only for the equalizer
 
hats off to that guy
@WeirdNerd nope much more
 
And they are a tea not just a single guy
 
lots of cool stuff
 
poweramp is your app ?
 
@RaajaSN gradle.properties(project properties) file ??
 
7:44 PM
nope
 
@TheNightKing No no
 
@WeirdNerd then you can use it .. just add these lines in gradle.properties ... org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
yes
 
you asked best i told you best
 
you will find these lines comment out there
 
poweramp is best
 
7:44 PM
@ankitagrawal then in which music player app you are using bound service
 
NDK is fast OpenEL gives more effeciency...
 
mine
mine is nowhere what that team did
 
It is happening
 
so Poweramp utilised both
 
7:45 PM
The song is quitting if I go back
I mean the song is stopping when I press back button
Something weird happening with me
I am running it in an emulator
 
i already told you why it is happening with you
your implementation is wrong
 
I am calling the unbind service too
Ok..
Sorry to disturb I will ping you tomo
 
@ankitagrawal Where are you working?
 
@RaajaSN a shitty company i guess
too shitty
 
ha ha :)
 
7:47 PM
btw
@TheNightKing i solved my scrolling issue
 
@ankitagrawal good
 
now its butter smooth
 
@RaajaSN
 
better than coordinator layout
 
but where is your app
 
7:48 PM
you want my app link
?
 
ok wait
 
@TheNightKing too curious....
 
@RaajaSN Correct ??
 
7:48 PM
yes try it
 
@TheNightKing
take it fast
i am gonna remove it
gn guys
 
why are you removing it... Its a promotion for your app
 
Good night Ankit
 
anyway good night @ankitagrawal
 
7:51 PM
@WeirdNerd try building your project. I hope it helps...
 
Ok sure
@RaajaSN Thanks a lot for whatever the help you did to me today
 
then i hope it worked
NP
 
The gradle thing worked
Now I am feeling sleep tomorrow as you said I will create some notification buttons and then call unbind from there
 
Good.. Good night... Happy Coding..............
 
Thanks !
 
8:00 PM
someone , tell a joke please
 

« first day (1329 days earlier)      last day (2146 days later) »