xamarin.android

Display a page with extended information

ぐ巨炮叔叔 提交于 2021-02-05 11:27:28
问题 I have the following functionality given below: When clicking on details, i want the text that is displayed on the contentview shall be displayed on the new detailspage that is created by push async. How can I send parameters containing the info given in the content, e.g. title, category and description. I have a tap gesture recognizer: <Label.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/> </Label.GestureRecognizers> That then leads to creating a new page

Display a page with extended information

﹥>﹥吖頭↗ 提交于 2021-02-05 11:27:25
问题 I have the following functionality given below: When clicking on details, i want the text that is displayed on the contentview shall be displayed on the new detailspage that is created by push async. How can I send parameters containing the info given in the content, e.g. title, category and description. I have a tap gesture recognizer: <Label.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/> </Label.GestureRecognizers> That then leads to creating a new page

How can I rotate an ImageView?

半世苍凉 提交于 2021-02-05 09:40:45
问题 I want to rotate an ImageView programmatically in my Activity. Currently I couldn't find any solutions for Xamarin which works and translated solutions from Android didn't work either. Does anybody know how to rotate an ImageView? This code for example just gives me a NullPoinerException and I don't know why: [Trace] error opening trace file: No such file or directory (2) [Mono] Image addref mscorlib[0xb7c3b4b8] -> mscorlib.dll[0xb7c771b0]: 1 [Mono] AOT module 'mscorlib.dll.so' not found:

Xamarin Android 7+ install APK programmatically

泄露秘密 提交于 2021-02-05 04:50:09
问题 I am trying to install an .apk I have downloaded to the downloads folder in Android 7. I have tried the way recommended in a number of StackOverflow posts and here https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en by using a FileProvider: File file = new File(fileUri); //using Android.Support.V4.Content; var downloadUri = FileProvider.GetUriForFile(context,context.ApplicationContext.PackageName + ".com.package.name.provider", file); Intent

Xamarin Android 7+ install APK programmatically

爷,独闯天下 提交于 2021-02-05 04:45:59
问题 I am trying to install an .apk I have downloaded to the downloads folder in Android 7. I have tried the way recommended in a number of StackOverflow posts and here https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en by using a FileProvider: File file = new File(fileUri); //using Android.Support.V4.Content; var downloadUri = FileProvider.GetUriForFile(context,context.ApplicationContext.PackageName + ".com.package.name.provider", file); Intent

Loading a font in skiasharp

余生长醉 提交于 2021-02-04 19:14:10
问题 How to use a custom font in skiasharp from Xamarin forms. I tried paint.Typeface = SKTypeface.FromFamilyName("CoText_Bd"); and paint.Typeface = SKTypeface.FromFile("CoText_Bd"); But both didn't worked out. Do i need to access the path of the font using dependency service ? 回答1: If you want trully multiplatform solution, put all SkiaSharp/PaintCode drawing Code into .NET standard library, including fonts as embedded resource (Don't forget to set Build action to Embedded resource!). Then you

Xamarin AlarmManager not firing when app sleeps

主宰稳场 提交于 2021-01-29 21:32:59
问题 I have following code to fire an alarm at exact time. When my app goes to sleep/background, Alarm does not FIRE , however as soon as I unlock my phone, then it fires right away. Intent i = new Intent(this, typeof(MyReceiver)); i.PutExtra("Speaker", txtSpeaker.Text); PendingIntent pi = PendingIntent.GetBroadcast(this, 0, i, 0); string _date = DateTime.Today.ToString("MM-dd-yyyy") ; string _time = tpick.Hour + ":" + tpick.Minute; DateTime scheduleAt = Convert.ToDateTime(_date).Add(TimeSpan

Xamarin AlarmManager not firing when app sleeps

穿精又带淫゛_ 提交于 2021-01-29 19:35:41
问题 I have following code to fire an alarm at exact time. When my app goes to sleep/background, Alarm does not FIRE , however as soon as I unlock my phone, then it fires right away. Intent i = new Intent(this, typeof(MyReceiver)); i.PutExtra("Speaker", txtSpeaker.Text); PendingIntent pi = PendingIntent.GetBroadcast(this, 0, i, 0); string _date = DateTime.Today.ToString("MM-dd-yyyy") ; string _time = tpick.Hour + ":" + tpick.Minute; DateTime scheduleAt = Convert.ToDateTime(_date).Add(TimeSpan

How to get the list of files with specific extension in Xamarin Android?

元气小坏坏 提交于 2021-01-29 19:02:18
问题 I need suggestion on getting a list of PDF files from the external storage in android device 回答1: 1.You could traverse the folder and filter the PDF files: public void Search_Pdf_Dir(File dir) { string pdfPattern = ".pdf"; File[] FileList = dir.ListFiles(); if (FileList != null) { for (int i = 0; i < FileList.Length; i++) { if (FileList[i].IsDirectory) { Search_Pdf_Dir(FileList[i]); } else { if (FileList[i].Name.EndsWith(pdfPattern)) { //here you have that file. } } } } } then you could call