If you want to access the current activity on Android you will need to use the code below:
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity
They made it very easy to access it. Appreciate it!
András Tóth's professional blog | banditoth
.NET, .NET MAUI, Xamarin.Forms developer from Hungary
If you want to access the current activity on Android you will need to use the code below:
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity
They made it very easy to access it. Appreciate it!
On Windows change directory to:
C:\Program Files (x86)\Java\jre1.8.0_271\bin
Give out the following command for keytool
keytool -list -keystore "C:\source_to_keystorw\keystorefilename.keystore" -storepass supersecurepassword
Results the following:
Keystore type: jks
Keystore provider: SUN
Your keystore contains 1 entry
com.companyname.projectname.appdeliverykey, 2021.05.20., PrivateKeyEntry,
Certificate fingerprint (SHA-256): 44:58:C2:B6:84:0A:9C:E0:09:8A:DD:ED:8C:EC:E7:BD:3D:0F:CC:17:32:BC:77:D6:BB:32:E8:5B:43:25:84:DF
If you are facing this issue:
R.java : error APT2258: invalid symbol name 'com.companyname.appname:drawable/xxxx'.
You should check for your Resources folder, and look for files with name like a C# or Java keyword. For example: new, public, private, static, class, and so on.
If you rename the file, it will solve your problem.
When trying to deploy an application to simulator or device, Visual Studio gives the following error:
Cannot find `aapt.exe`. Please install the Android SDK Build-Tools package with the `C:\Program Files (x86)\Android\android-sdk\tools\android.bat` program.
To solve this problem you sould go to Visual Studio’s Tools then Android and select SDK Manager option.
It will give an error dialog, that the SDK tool files are corrupted. Click repair.
The mentioned batch command in the error message is deprecated by the way.
Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\Users\banditoth>cd C:\Program Files (x86)\Android\android-sdk\tools\
C:\Program Files (x86)\Android\android-sdk\tools>android.bat
**************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
**************************************************************************
Invalid or unsupported command ""
Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk
C:\Program Files (x86)\Android\android-sdk\tools>
If your Android application gives the following error, when trying to use a HttpClient:
Java.IO.IOException: 'Cleartext HTTP traffic to 192.168.0.10 not permitted'
Set usesClearTraffic property to true in the AndroidManifest.xml:
<application android:label="MobileSolution.Android"
android:theme="@style/MainTheme"
android:usesCleartextTraffic="true">
</application>
The restriction was introduced in Android 8. More explanation: https://koz.io/android-m-and-the-war-on-cleartext-traffic/