LG + Moto Location checking issues - android-location

I work on a location-based app. Seeing some weird trends where LG & Motorola phones on android 9+ (at least) are reporting location off at 2x their usual rates. Samsung has remained flat. This presents a problem as false negatives here create some very negative user experiences. I'm using this to see if the location is on for the device.
LocationManagerCompat.isLocationEnabled(locationManager)
It is not correlated with low battery. Should I just not use this API? Does anyone have insight on this?
Update: Found that this was related to a code release in the app. Moving from Firebase Job Dispatcher to work manager is causing this. On LG & Moto Phones, when WorkManager runs a location check in the background with battery saver enabled the call will incorrectly return false. I've repro'd this, the solution is not to call this in work manager, but really seems like a deeper bug that lurks somewhere in the depths.

Related

Bluetooth Service Solicitation in Windows UWP

I am trying to connect to my iPhone and access services such as the battery level and ANCS from windows. I have tried out the Advertisement watcher and query but I feel as though they are really inconsistent. I am just using the code they provided in their updated documentation. I feel as though my results are extremely buggy. Devices show up multiple times and then become unreachable. It's almost as if past devices are never cleared from the cache (this may need to be something I do manually?) upon restarting my UWP in debug x86. I have briefly had success with the advertisement watcher and was even able to initiate pairing. Although when I read the battery level it was still not a number after using the data reader. I noticed that there were some service solicitation properties on the documentation but I could not figure out how to use them. Would these help and if so how could I use them? This might be useful when I try to connect to the ANCS of my iPhone.
Edit 1: After trying out the sample provided by Microsoft, I am still having a similar issue. I am able to see devices and even pair with them but when I click the connect button, it returns that there is a connection failure. In order to advertise to the BLE I am using the LightBlue app on my iPhone to advertise a virtual peripheral with the battery service added. My end goal is to connect to the iPhone directly and access some of its native BLE services and characteristics. I have heard that this can be done with something called service solicitation but have failed to successfully find any real examples of this being put into practice in a UWP (maybe it's not used anymore). I am still pretty new to BLE so I am trying to work out some of my fundamental misunderstandings of how it works so if there is something I am missing please let me know below!
BLE Failing to connect after pairing.
Edit 2: Ok after cleaning and re-building to fix some of my silly mistakes, I can now say that the example project is running as intended from what I can tell. The solution is actually pretty nice and I can see it is much more elegant than my implementation. However, I see that I am running into the same issue as before where the services of my virtual peripheral become undiscoverable after pairing and now result in a "Device Unreachable" exception in scenario 2. It seems as though Windows does not support "Resolvable Random Private Addresses." To elaborate, it does not provide my phone with an Identity Resolving Key (IRK) upon pairing with my iPhone 11 in order to keep track of its address. In order to access certain key characteristics, I need authorization.
Is there any way I can exchange an IRK upon pairing using the custom pairing capability or is there another method to provide authorization in order to access these characteristics on my iPhone? As it is, ANY and ALL GATT services present on the iPhone (virtual peripheral or native OS) become unreachable as soon as I successfully pair with the device. I am hoping it is possible to implement a solution in Windows as if not then communicating meaningful data between modern devices seems impossible with outdated privacy protocols.
I did a little bit of research and it is either the problem above or something to do with my Bluetooth device.
If I were to try to access characteristic without pairing
Edit 3: I have been able to get it to work briefly and it was wonderful. I used the system settings to pair and magically got the prompt on my phone to share notifications. From there, I had authorization/authentication and everything else I wanted to do was a breeze. Unfortunately, this does not seem to be reproducible as I have to randomly pair and unpair while starting and stopping the sample solution to get this prompt. I don't entirely remember what was happening when it popped up, but it does not seem easy to recreate. I thought that pairing would be my solution, but I am now stuck. When I pair with the device, I cannot access any services, but when I am unpaired, I can see all of the services and characteristics I need. However, when trying to subscribe to those characteristics I get "System.Exception: 'The attribute requires authentication before it can be read or written. (Exception from HRESULT: 0x80650005)'." Is there any way for me to request access to the notifications on my iPhone using something in the documentation? I need a reproducible way to request system notification access on my iPhone.

How can i maintain Agora.io video call memory usage

Platform Unity 2019.4.8.f1
Apk tested on Android devices
Api lvl 21+
Test failure on some devices that have 2gb memory.
Our team has implemented a unity project and we use agora for video call. Our streaming configs are very low, 15fps, 65bit. But when we test the app on phones that have 2gb memory, some times later(about 5-10min) app crashes. We try to find out the problem and according to diagnostic tools agora uses lots of memory, We cannot find any limitation from agora sdk and cannot reduce memory usage, is there any idea about this. Thanks.
First, did you make sure if this is an Application level memory management issue? e.g., you created instance of renderers but did not release in time?
If it is SDK level issue, you probably won't find a solution from the public. I suggest you to create a ticket to ask the question directly to the Agora support team. Please provide your quantified analysis and the crash log when you submit that.

No video feed from M600 Pro with mobile SDK

I'm having trouble getting the video feed working from the M600 Pro. It works fine in the DJI Go App so I know the feed is there, just not in my IOS app. When we initially setup the app up for the M210, we needed to set bandwidth allocation to make it work, wondering if there is something like that needed for the M600 Pro? Has anyone got that working?
Below is my code:
if (product?.model == DJIAircraftModelNameMatrice600Pro) {
DJISDKManager.videoFeeder()?.secondaryVideoFeed.add(self, with: nil)
}
VideoPreviewer.instance().start()
Yes bandwidth could be an issue but also, other aspects of your setup could influence this blockage. Without knowing your entire set-up this is a difficult question to answer since the M600 has a variety of variables. The best thing to do is send a ticket to dev#dji.com with this issue but include - what cameras you are using, outline how you've made the connections, your setup for bandwidth, the reason you are using secondaryVideoFeed vs. Primary and any other details you can think of.

Android Wear 2.0 Complications Minimum Update Time

According to the Android Wear Developer Training guide for Wear 2.0 Watch Face Complications, though the developer can, via the manifest file, define a set interval where a complication provider can request an update, there is the caveat that "update requests are not guaranteed to be sent with this frequency" and that "the system does apply a minimum update period, and in particular, update requests may come less often when the device is in ambient mode or is not worn."
Is there any documentation or source specifying exactly what this minimum update period is, or how it is derived?
UPDATE: The reason that I am asking this is that our organization is looking to develop an application that will both run on Apple Watch and Android Wear, and it was noted by the Apple Watch side of development that the Apple Watch OS only permits 50 updates to their complications for every 24 hour time period; the project manager for this application is very curious if the Android Wear 2.0 OS has any similar restrictions, or if a developer is, in theory, capable of updating complications "freely" (i.e. without consideration of the end user's device's battery).
As I've read the documentation you linked, it didn't state the minimum update period you can specify. However, based from this example, developers should consider intervals in the order of minutes. Also, remember that this is only a guidance for the system. Android Wear may update less frequently. Unfortunately, I cannot also see any documentation regarding the exact time to specify but this value should be set as large as possible, to not have a too big impact on the device battery, due to frequent updates. You can check this blog. But if your app needs to push updates instead of updating on a regular schedule, you should set this value to 0 and use ProviderUpdateRequester.requestUpdate() instead to trigger an update request when you need one.

What clients for web application?

Is it true that web browsers as we know today have no future? That programmers should write native clients for their application on many devices?
I'm writing web application with AJAX but should I also prepare versions to many mobile devices?
The web will be around and web browsers are available on almost any device. Some say native development is the future, because it is closer to the device and gets the most out of the system. This is true and is applied in various cases, like XBOX games and Apple software that is especially designed for a single device.
Other developments show the other side. Google's OS is barely more than a webbrowser. All applications running on it are merely web applications that should run on any browser. Only difference is that the engine of Chrome OS is put directly onto the hardware, allowing the webpage to get a better performance, because it has only one abstraction layer to the hardware instead of 3 or 4.
So, the only advice I can give is not to worry about it. People on either side have been declaring the other technique to be dead since decades ago, but both are still here. When it is time to switch, you will know. :)
The first statement is definitely not true.
The second one depends on your case, but most things you can just do "mobile-browser friendly". I.e. make a mobile version of the website that looks good on mobile browsers. No need for mobile applications.
Of course, if you have the resources, a mobile app is a good addition to your portfolio / brand.
First of all no one knows and no one can know what the future will bring.
For me though, it is difficult to imagine a world without web browsers at least in the near/mid term future, especially with all the hype/support behind HTML 5.
The big advantage is of HTML 5 in this regard is write once, run everywhere.
My 2 cents ;-)
If anything, it is the other way around. Make a good web application, and everyone can use it. Mobile browsers get better and better all the time. Expect mobile website usage to increase, rather than custom applications for each device. (obviously, applications that need hardware access are not included in this statement.)
Furthermore, expect a convergence between mobile web and desktop web.

Resources