Android emulator can't intercept SMS messages when app is closed - visual-studio

I am developing an Android app with "Xamarin.Android" to intercept incoming SMS messages. When I deployed the app using the Visual Studio built-in emulator (Android 9 image), the SMS is not intercepted when the app is closed. But when I deployed the same app on Galaxy Note 8 (Android 9), it worked perfectly.
I dug up more details about the updates and changes in recent Android versions and how it handled background services and the limitations on implicit broadcast receivers. I found out that the SMS_RECEIVE is already exempted from any restrictions, so the broadcast should be delivered to my app, even when it is closed.
I rewrote the SMS Broadcast receiver part using Java to test it in Android Studio; it worked on the Android Studio emulator and device.
Is this a common issue in the Visual Studio emulator? Is there a configuration that I need to change?

It turned out the solution was only to update the built-in Android Emulator that was included with Visual Studio.
I was using an older version (28.0.25) that was released last March, while the new available version (29.2.1) released in September solved the issue with this simple update, although this issue was not highlighted in any of the release notes of the stable versions since march.

Related

Xamarin App Google Play Store Incompatible Chromebook VS 2019

I have developed an Android app using Visual Studio 2019 and Xamarin Forms, all patched with the latest updates. For verification on an Android device, I purchased an Asus C214M Chromebook and published to it from within Visual Studio. To boost my confidence level, it published and ran both debug and release versions of my app.
In the process of publishing to Play Store, I added d8 as the dex compiler and release still runs on my Chromebook.Once it is published to Play Store it shows compatibility with 13,060 devices and there are no exclusions. When searching for Chromebook or Asus my device does not show up and no Chromebooks show as compatible.
Research and testing experience show that Xamarin apps are compatible with Chromebook, so what could I be missing in the manifest or compiler settings? The link is https://play.google.com/store/apps/details?id=com.linkemupllc.wetyourwhistel. Any suggestions?

Can I connect an iPhone to a windows 10 machine to see my work in Flutter?

I want to see my work without using a simulator from Android Studio. Currently I have an Android Phone and it works when I connect my phone with Windows 10.
Can I do the same with an iPhone?
Flutter relies on Xcode and the iOS SDK to perform the underlying compilation and publishing of iOS apps. Unfortunately, it's not possible to do iOS development on Windows, a Mac is required.
Some googling reveals there are several online services, such as MacInCloud and MacStadium that provide a means to pay for a remotely accessible VM in the cloud if you'd prefer not to purchase a Mac, though not having used any, I can't personally vouch for any of them.

Why am I having trouble with the Android Emulator in VS Comm 2017?

I was having trouble using the Android emulator in Visual Studio Community 2017 and I decided to create a blank project to see if it will run. I get this error message when attempting to run it in the Live Xamarin Player:
Starting Android Emulator Android_Accelerated_x86_Nougat...
Failed to boot Android device emulator-5554...
Unable to deploy to Android_Accelerated_x86_Nougat, please ensure the Xamarin
Live Player app is open and the device is on the same network as Visual Studio.
Why would I have trouble running the emulator in a fresh blank project when I didn't even write a single line of code? Thanks for your help.
UPDATE: So I installed the latest Android SDK 8.0 along with they system image and tried to create a virtual device that uses it. But the Android Virtual Device Manager shows a, 'No system images installed' message when I selected the 8.0 framework. So I installed an earlier version of the SDK along with a system image (5) and was able to create a virtual device with it. So another question is why wouldn't the system images show up for the 8.0 framework?
The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll
(vv8.0) is greater than the $(TargetFrameworkVersion) for your project
(v7.1). You need to increase the $(TargetFrameworkVersion) for your
project
This means the Xamarin.Forms library is targeting Android 8.0 (API level 26) but your project is setup for Android 7.1 (API level 25). You can't change the Xamarin.Forms target version without downgrading, but you can change your project target version easily. You can learn more about these concepts from Xamarin. Be aware some of the details of that Xamarin blog post are already out of date!
There is another nice blog post from Xamarin which can walk you through the process of setting your system up for Android 8.0 API level 26. It's normally not this complicated, but Google changed their SDK tools internally between 25 and 26 in very major ways. They changed from GUI tools to command line tools.
You'll probably also want to get the (in preview) Xamarin Android Device Manager if you don't have a physical device to test with. This Xamarin Android Device Manager tool is the only way to create and configure API 26 and higher emulators without using the Google command line tools.
It seems as though Google has gotten rid of the GUI apps that manage the SDK and Virtual Devices in the latest version, so when you try to create a new virtual device with 8.0 it's not compatible with the GUI tools. Until Xamarin releases a GUI tool to replace them we can use the command-line to manage the SDK and virtual devices.
https://learn.microsoft.com/en-us/xamarin/android/troubleshooting/sdk-cli-tooling-changes
https://developer.android.com/studio/command-line/avdmanager.html

Xamarin workflow on Windows

I'm aware that a Mac or a Mac service e.g. MacInCloud.com is necessary for building and submitting iOS apps.
My question is about the actual workflow of building an app on Windows using Xamarin on Visual Studio 2017.
We need to write code, test and debug throughout development cycle. How does this work with Xamarin running on Windows? How would I actually see what my mobile app looks like or behaves during the actual development cycle?
While developing my web apps in Visual Studio, there are many trips back and forth to the browsers and back to VS in order for me to see the results of my code. How does this work with Xamarin running on Windows? Is Xamarin Live Player the only option for development cycle? Is there a solution through MacInCloud or similar services so that tethering a device to dev machine is not necessary?
I'm just trying to understand how a healthy development cycle is created for Xamarin developers on Windows.
I will answer your question in few section: Coding, Debug, Test
Coding
You will be using Visual Studio to write your codes. iOS and Android code will be written in C#. You will get access to UI Designer for both iOS and Android to edit the layout files and storyboard/xibs. For 3rd party library, there is NuGet to serve your needs.
Debug
You can use Xamarin Live Player without connection to a Mac/MacInCloud for basic preview. However, some features of iOS is not available in Xamarin Live Player (e.g. xibs files not supported...).
If you setup with connection to a Mac, you will be able to see a list of Simulator that available in the Mac you connected to. By default, if you debug it, the simulator will still show up in the Mac. Then you will need to VMWare or remote into the Mac to check the simulator output. If you have Visual Studio Enterprise license, you can get access to a Remote iOS Simulator feature. You will need to turn the option ON. After that, you will able to see a remote iOS Simulator showing in your Windows machine without the needs to remote into Mac machine anymore. For debugging in actual iOS devices, you will still need to plug your device into the Mac. Previously (more than 1 years ago), Xamarin announce that they are working on "iOS USB remoting" to allow you to plug in iOS device into Windows machine and debug on it. But it is not release until now.
For Android, you can get access to Android Emulator Manager to add emulator to debug or you can deploy apps to physical phone just like what you can do with Android Studio.
Test
I will be referring to Xamarin.UITest for this part. You will be able to write UITest code in C# inside Visual Studio. Xamarin have product "Xamarin Test Cloud" to allow you to upload test code and binary and then run your test in cloud periodically. If you want to run the test locally in your machine, you will only able to run Android UITest in windows machine. To run iOS UITest locally, you will only able to run it in Mac machine. Using a Mac, you can also run Android UITest.
You can use a simulator/emulator instead of a device. For iOS, the simulator would run on the Mac Build Host that you are connected to. You can select the option for "Remote iOS simulator" in Visual Studio -> Xamarin.iOS options and you'll be able to interact with the simulator without having to RDP/VNC/look at the mac. For android, you can just run an emulator in Window and interact with it like that. Using your web apps comparison, you would use a simulator/emulator instead of browser but, for the most part, the process would be similar.
I have been developing a Xamarin MVVM app targeted at iOS and Android. I initially did the iOS development on Windows with VS 2022 and an iPhone attached via USB. I knew that I was going to have to eventually move to the Mac for final provisioning but I ended up taking that painful step earlier than planned because certain Xamarin features were just not working on Windows. First I could not get my app icon to be anything other than the Xamarin default and then Xamarin.Essentials.FilePicker would not select a file:
https://github.com/xamarin/Essentials/issues/1710
So after a week of struggling I finally got my project building and deploying on the Mac. However, I am not nearly as comfortable working on the Mac as I am on Windows where I have all my familiar development tools. So then the question was how to share the project files between the PC and the Mac so that I could edit and compile on the PC and then move to the Mac for final testing.
At first I tried iCloud but I could never get the files to sync reliably between the shared folder on the PC and the Mac. I am used to Dropbox and OneDrive, which work as expected. iCloud not so much.
So what I have been doing is committing and pushing the changes to github and then pulling the changes into the project on the Mac. It is quick and has the added benefit of version control using an offsite server. I am happy with this workflow and publishing the app on the Apple Store should be an easy task when that time comes.
Update:
This process is still working for me. I have taken the additional step of doing the release configuration on VS Mac and publishing my app to App Store Connect. That experience was convoluted and frustrating but it now works and I have people testing my app via TestFlight.
One hiccup is that when selecting Automatic iOS Bundle Signing in the project properties on VS Windows, this change gets pushed to the Mac side and causes a build error under Debug until I select the Automatic provisioning profile on the Mac. Somehow it gets set to the Wildcard profile on the Windows side.

Basic Android App not working on Xamarin Android Player via VS2015

I have been trying to run basic Android App provided by Visual Studio 2015 via XAMARIN Android Player. Program gets build and deployed successfully, yet, App or anything does not appear on screen. Xamarin Player takes more than 20 mins to start and then nothing happens. Find Screenshots as well.
WIthin the Android SDK Manager look under Extras there is an package called Intel x86 Emulator Accelerator (HAXM Installer). Installing HAXM will increase the speed of the emulator when you use the Intel Atom CPU/ABI
Also when creating the emulator device check Use Host GPU for increaded performance.
I ran into few issues with Xamarin Android Player as well. Currently I am using Genymotion Emulator and it is much faster.
Well, Well, Well, I got my thing up and running. Following are the steps I performed:
After installing Xamarin for VS2015, I checked for latest Android SDK via SDK Manager. Got all the necessary updates installed.
Installed Xamarin Android Player and used emulator Nexus 5 KitKat API level 19.
Earlier I was using Nexus 5 Lollipop, was the reason why, it was not working. May be its not fixed for buil yet.
As, described by Mr.Pilatus in above answer, the particular HAXM things surely does help in accelerating emulator.
Got my Android app running.
Thank you all for all the necessary suggestion and guiding my in my baby steps in XAMARIN development. Gracias. NAMASTE!

Resources