<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Accessing the GenericOnOffStatus in nRF Mesh Android Activity after doing a GenericOnOffGet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36817/accessing-the-genericonoffstatus-in-nrf-mesh-android-activity-after-doing-a-genericonoffget</link><description>As per one of my discussions with , on another thread here , I can send a GenericOnOffGet from my android activity and I will get the status of the light in GenericOnOffStatus construct. 
 But the code from Nordic employs the use of mViewModel which through</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Oct 2018 17:17:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36817/accessing-the-genericonoffstatus-in-nrf-mesh-android-activity-after-doing-a-genericonoffget" /><item><title>RE: Accessing the GenericOnOffStatus in nRF Mesh Android Activity after doing a GenericOnOffGet</title><link>https://devzone.nordicsemi.com/thread/155421?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 17:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf475009-9f7f-4137-ac84-15705dcbd436</guid><dc:creator>Jackes5</dc:creator><description>&lt;p&gt;Sorry about that. Yes, I&amp;#39;ve just checked it and found what I was looking for. Thank you so much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing the GenericOnOffStatus in nRF Mesh Android Activity after doing a GenericOnOffGet</title><link>https://devzone.nordicsemi.com/thread/155418?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 17:05:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddf7113f-55cf-4ab7-9de3-5c2a62ad1e8c</guid><dc:creator>Roshan Rajaratnam</dc:creator><description>&lt;p&gt;@Jackes5 we would really aopappreci if you had created a new ticket for new questions. This was simesomet missing in the library, but the latest dev branch has added new changes that include this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing the GenericOnOffStatus in nRF Mesh Android Activity after doing a GenericOnOffGet</title><link>https://devzone.nordicsemi.com/thread/155410?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:18:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:043004f5-925a-49ea-a1d3-e8c0b91eb22f</guid><dc:creator>Jackes5</dc:creator><description>&lt;p&gt;Hi Roshan. Isn&amp;#39;t there a way to know whom GenericOnOff status is? I send the GenericOnOffGet, but the observer can only tell me when the status changes, but not who&amp;#39;s the source of that status. I cannot know which node has that change.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Accessing the GenericOnOffStatus in nRF Mesh Android Activity after doing a GenericOnOffGet</title><link>https://devzone.nordicsemi.com/thread/141252?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 06:06:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d6fcd14-43a9-49be-881d-5823957c28c5</guid><dc:creator>Roshan Rajaratnam</dc:creator><description>&lt;p&gt;Hi Xavier, The reason for using a ViewModels is to adhere with the new Architecture Components by Android. This separates a lot of the logic&amp;nbsp; that had to be written within an activity class.This also handles Configuration changes and lifeycle of activities in Android avoiding us developers needing to save complex UI states across orientation changes. The ViewModel has a reference to the particular repository we are talking to. Whenever a status message is received the activity observing the particular LiveData object will be notified.&lt;/p&gt;
&lt;p&gt;During our last discussion you decided to bind to the service directly without the use of ViewModels which also is fine.&lt;/p&gt;
&lt;p&gt;What you may do is to register a broadcast receiver in your activity, this way you can notify your activity for any events that occur in the service. I have used the same approach to notify events from the service to a particular repository. In your case you might want to look at&amp;nbsp;BaseMeshRepository and these broadcasts are sent from the MeshService.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>