tag:blogger.com,1999:blog-8214401912480503366.comments2023-08-10T13:35:15.093+02:00My life with Android :-)Gabor Pallerhttp://www.blogger.com/profile/14307475522972458932noreply@blogger.comBlogger1228125tag:blogger.com,1999:blog-8214401912480503366.post-7415380185627006582018-05-03T02:32:16.579+02:002018-05-03T02:32:16.579+02:00Thank you! Very helpful post!Thank you! Very helpful post!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-26355210048066600722017-10-04T11:49:50.020+02:002017-10-04T11:49:50.020+02:00Elangovan, as I wrote the onBind *is* called once ...Elangovan, as I wrote the onBind *is* called once for the same Intent. <a href="https://developer.android.com/reference/android/content/Intent.html#filterEquals%28android.content.Intent%29" rel="nofollow">Intent.filterEquals</a> defines, when two intents are the same. It says:<br /><i>Determine if two intents are the same for the purposes of intent resolution (filtering). That is, if their action, data, type, class, and categories are the same. This does not compare any extra data included in the intents.</i><br /><br />So filterEquals does not consider the extras but if other fields are different, they are different Intents. In our case, the category was different. As filterEquals does not match, the machinery behind the IBinder caching does not consider the two bindService requests connecting to the same service, even though the invocation eventually ends up in the same Java implementation (CounterService.java). Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-34669790475323481552017-10-02T19:04:18.565+02:002017-10-02T19:04:18.565+02:00Hi Gabor,
That's interesting. In my experien...Hi Gabor, <br /><br />That's interesting. In my experience I saw the onBind method called only once for a service lifetime even though multiple clients binds to the same service. it is different story if the service is destroyed and recreated again.<br /><br />Could you please provide your feedback on the following explanation from google's android developer's site. <br /><br />https://developer.android.com/guide/components/bound-services.html#Basics<br /><br />"You can connect multiple clients to a service simultaneously. However, the system caches the IBinder service communication channel. In other words, <b> the system calls the service's onBind() method to generate the IBinder only when the first client binds. The system then delivers that same IBinder to all additional clients that bind to that same service, without calling onBind() again.</b>"<br /><br />May be we are not talking about the same thing?Elangovan Manickamhttps://www.blogger.com/profile/06528923301361838364noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-2728740278717329932017-09-27T12:49:48.543+02:002017-09-27T12:49:48.543+02:00Lima, is this presentation a good starting point?
...Lima, is this presentation a good starting point?<br /><br /><a href="http://mylifewithandroid.blogspot.hu/2013/10/sensor-fusion-between-car-and-smartphone.html" rel="nofollow">Sensor fusion between car and smartphone </a><br /><br />Start with slide 34.Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-66872971887616425042017-09-27T00:43:55.072+02:002017-09-27T00:43:55.072+02:00Elangovan, you are wrong when you say that in this...Elangovan, you are wrong when you say that in this case the service will be bound once. Even though it is the same service implementation (CounterService.java), it is bound by different Intents hence considered different services by the Android service framework. If you don't believe, try it yourself. I now updated the post with sources adapted to newer Android tool chains (in particular, the aexp.oneway package name crashed the 25.0 aidl tool because it thought that "oneway" in the package name is a keyword hence every package name has been renamed "one_way") and ran the example on my Nexus 5 (Android 6.0.1).<br /><br />The service is bound twice:<br />09-27 00:24:44.701 25653 25653 D ONEWAYACTIVITY: bindService(): IncreaseCounter<br />09-27 00:24:44.702 25653 25653 D ONEWAYACTIVITY: bindService(): Counter<br /><br />and onBind is called twice:<br />09-27 00:24:44.710 25653 25653 D COUNTERSERVICE: onCreate<br />09-27 00:24:44.710 25653 25653 D COUNTERSERVICE: onBind: Intent { cat=[android.intent.category.aexp.one_way.if.increasecounter] cmp=aexp.one_way/.CounterService }<br />09-27 00:24:44.710 25653 25653 D COUNTERSERVICE: category: android.intent.category.aexp.one_way.if.increasecounter<br />09-27 00:24:44.711 25653 25653 D COUNTERSERVICE: onBind: Intent { cat=[android.intent.category.aexp.one_way.if.counter] cmp=aexp.one_way/.CounterService }<br />09-27 00:24:44.711 25653 25653 D COUNTERSERVICE: category: android.intent.category.aexp.one_way.if.counter<br />09-27 00:24:44.726 25653 25653 D ONEWAYACTIVITY: IncreaseCounterServiceConnection::onServiceConnected<br />09-27 00:24:44.727 25653 25653 D ONEWAYACTIVITY: CounterServiceConnection::onServiceConnected<br /><br />Please, observe that even though the service class is the same (aexp.one_way.CounterService), the Android service framework handles these two services separately. As they are indeed separate services.Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-14302502753194702572017-09-20T14:57:34.167+02:002017-09-20T14:57:34.167+02:00I know this thread is 7 years old now. But I just ...I know this thread is 7 years old now. But I just want to point few things about this blog.<br /><br />First, the onBind() method on the service will receive the call only once in its lifetime. Even though multiple clients trying to bind to the same service, the android system just returns the cached IBinder object without calling the onBind method. So I couldn't understand how your 'If' condition in the onBind method will work. if you want them to work then you need to stop the service before binding again.<br /><br />Second, the oneway keyword don't have any impact if the service and client are in same application or in same process. Your example looks like having all in one app. So the asynchronous behavior that you expect wont happen. <br /><br />Elangovan Manickamhttps://www.blogger.com/profile/06528923301361838364noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-60476650156808709132017-09-18T22:02:58.231+02:002017-09-18T22:02:58.231+02:00Hi guys, i need some help with my project. I want ...Hi guys, i need some help with my project. I want to build an android app that detects bumps on the road using the smartphone sensor "accelerometer" that measure the intensity of vibration when the vehicle hits the bump, and then the smartphone GPS is used to locate the bump. Well my problem is: how we can measure the intensity of vibration using the acceleration????<br />Thank you for any help you can give meLimanoreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-82051724120170459422017-09-01T13:51:11.156+02:002017-09-01T13:51:11.156+02:00Thanks..I've been looking for the solution fro...Thanks..I've been looking for the solution from past 3 hrs ....finally this one worked for mevj7https://www.blogger.com/profile/00127603584883285763noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-27238782957755992332017-08-14T00:08:49.686+02:002017-08-14T00:08:49.686+02:00Amazing thanks for help it workedAmazing thanks for help it workedAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-25961553249353234912017-07-06T10:24:58.466+02:002017-07-06T10:24:58.466+02:00Thank you very much for your help.
I managed to so...Thank you very much for your help.<br />I managed to solve the problem by as you said downloading the SDK 10. The project still didn't compile then. I had to modify the makefile and put the project in a specific folder, i think it's in BLE peripheral examples one and modify the paths to the files you include.<br /><br />Thanks again for your very helpful tutorial!Anonymoushttps://www.blogger.com/profile/17529804760493823709noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-6872214462650865302017-07-06T09:39:13.225+02:002017-07-06T09:39:13.225+02:00Yamine, I have experience with version 10 (on whic...Yamine, I have experience with version 10 (on which this project is based) and version 12 (on which <a href="http://mylifewithandroid.blogspot.com/2016/10/android-phone-as-weather-station-with.html" rel="nofollow">this project is based.</a> My experience is that porting between these two SDK versions were quite painful. My advise would be to move to the project with version 12 (link is above). That project uses a different temperature/humidity/pressure sensor but maybe it is easier to backport the DHT-22 logic from this project than to convert this project into SDK 11/12.<br /><br />Alternatively, you can try to download SDK 10. They are all on the website, older versions just don't have links pointing to them.Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-82547200533103072262017-07-05T15:39:50.590+02:002017-07-05T15:39:50.590+02:00Yes, i have installed the SDK n°11, it probably is...Yes, i have installed the SDK n°11, it probably is where the problems come from,because SDK 11 doesn't feature anything for the S110 device?Anonymoushttps://www.blogger.com/profile/17529804760493823709noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-89747089357249067982017-07-05T13:27:06.030+02:002017-07-05T13:27:06.030+02:00Yamine, did you install the Nordic SDK? Which vers...Yamine, did you install the Nordic SDK? Which version?<br />Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-33591661635929605902017-06-30T11:20:59.770+02:002017-06-30T11:20:59.770+02:00Hello Gabor,
Thanks for your tutorial,it's ve...Hello Gabor,<br /><br />Thanks for your tutorial,it's very informartive.<br />I although have a problem when i try to compile your work on windows.<br /><br />I installed the ARM Toolchain and GnuWin in order to use the make command. The compiling of the files work until the point where it has to link files. And that's where he tells me the errors: <br />In function warump_timer_handler:<br />"Undefined Reference to ble_advertising_start"<br />In function sampler_timer_handler:<br />"Undefined Reference to ble_advertising_start"<br />"Undefined Reference to ble_advertising_start"<br /><br />I modified your makefile to make it work with my sdk installation Path but i didn't make any drastic change.<br /><br />Would you have any idea about a way to solve this error?<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/17529804760493823709noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-85535465472121560412017-06-29T14:33:20.049+02:002017-06-29T14:33:20.049+02:00This information is impressive; I am inspired with...This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.|<a href="http://www.credosystemz.com/training-in-chennai/best-android-training-in-chennai/" rel="nofollow">Android Training in chennai with placement </a> | <a href="http://www.credosystemz.com/training-in-chennai/best-android-training-in-chennai/" rel="nofollow">Android Training in velachery</a>Anonymoushttps://www.blogger.com/profile/00371767352380677133noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-84548980519653882782017-06-27T14:57:13.781+02:002017-06-27T14:57:13.781+02:00This is a wonderful article, Given so much info in...This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.<br /><a href="http://www.bestandroidtrainingchennai.in/" rel="nofollow">Android Training in velachery</a> | <a href="http://www.bestandroidtrainingchennai.in/" rel="nofollow">Android Training in chennai</a> | <a href="http://www.bestandroidtrainingchennai.in/" rel="nofollow">Android Training in chennai with placement</a> Anonymoushttps://www.blogger.com/profile/13662377101256298223noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-4391521708620306082017-06-14T12:48:17.559+02:002017-06-14T12:48:17.559+02:00This comment has been removed by a blog administrator.Anonymoushttps://www.blogger.com/profile/00371767352380677133noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-65628164507561023462017-06-06T12:25:56.001+02:002017-06-06T12:25:56.001+02:00;) :o (y);) :o (y)AndroidManifester Ranjithhttps://www.blogger.com/profile/03119251294184138226noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-75748106554298241902017-06-05T07:49:55.791+02:002017-06-05T07:49:55.791+02:00You have provided an nice article, Thank you very ...You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...android app development companyhttp://smarther.co/android-app-development-company/noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-33097446251580758412017-05-30T13:16:09.563+02:002017-05-30T13:16:09.563+02:00Excellent and very cool idea and the subject at th...Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it.What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity.<br /><a href="http://www.greenstechnologys.com/embedded-systems-training-in-chennai.html" rel="nofollow">Embedded Training in Chennai</a>Karthika Shreehttps://www.blogger.com/profile/06515257484162457182noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-57041964962908849822017-05-16T14:03:49.607+02:002017-05-16T14:03:49.607+02:00I am really impressed after read this so thanks fo...I am really impressed after read this so thanks for sharing.<br /><br /><a href="https://www.acconnectors.com/products/15-amp-to-20amp-adapter" rel="nofollow">EV adapter</a>AC Connectorshttps://www.blogger.com/profile/13571912379880528474noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-57378293893197017952017-05-08T12:21:29.514+02:002017-05-08T12:21:29.514+02:00Very Nice information shared about android. Keep ...Very Nice information shared about <a href="http://www.nareshit.in/android-training/" rel="nofollow">android</a>. Keep sharing tutorials. This blog post is really helpful.Sujit kUmarhttp://www.nareshit.com/noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-62210397273300337482017-04-28T12:29:50.931+02:002017-04-28T12:29:50.931+02:00nice blognice bloglizahttps://www.blogger.com/profile/06035184100892779826noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-91110361484331159432017-01-05T16:00:18.182+01:002017-01-05T16:00:18.182+01:00Deba, do any of your flow meters support BLE for r...Deba, do any of your flow meters support BLE for reading them with mobile device? Could be a useful feature. Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.comtag:blogger.com,1999:blog-8214401912480503366.post-57905151991305444142017-01-05T15:57:31.316+01:002017-01-05T15:57:31.316+01:00Tony, I wrote an e-mail to you about the issue. Co...Tony, I wrote an e-mail to you about the issue. Could you try the Android application linked to <a href="http://mylifewithandroid.blogspot.hu/2016/10/android-phone-as-weather-station-with.html" rel="nofollow">this post?</a> This application is very similar to yours (uses BluetoothLeScanner) but is reliably able to capture unidirectional advertisement packet indications that my sensors generate. Look for the onScanResult method in BLESensorGWService.java, there's a log message there.Gabor Pallerhttps://www.blogger.com/profile/02390936870056951146noreply@blogger.com