Migrating my app from PCL to .NET

I finally migrated my PCL (Portable) app which has been published for two years to .NET and thought I would share the experience. Just moving to .NET went smoothly for most things. The app is published to Android, iOS and UWP. I then updated packages and that's where the problems began. So here are some tips. My app uses SQLite databases and the sqlite-net-pcl broke when updating it's SQLite dependencies. So there I just deleted all the SQLite packages and reinstalled sqlit-net-pcl and let it install the compatible packages (currently not some of the 2.0 SQLite packages). So one has to be careful with batch updates because not everything is ready for prime time.

I offer printing in my app and the Android printing needs some serious updating. Older example code still works but warnings are given about the Xamarin Forms context however using a local context doesn't work ... yet. So I still use the older example code.

I allow the user to upload and download their database to Google Drive. Of course there is the Progress Dialog deprecation warning. Except the way I handle it the user could still cancel the download from the dialog. The fix there is going to take some experimentation given the way that API works.

At the moment most everything is working in the app except for one frustrating thing on UWP. The user can save PNGs of info and the designated folder is of course the Pictures Library on Windows. But I get a "access is denied" error. Now on the PCL version this worked fine. I can save text files to the Documents folder okay. The error is a NetCore error for UWP (Android works fine, haven't test the iOS version yet). Originally the error also occurred on text files but then I downgraded the NetCore package to the one used in my PCL version and text but not PNGs were writable. I also read through a number of reports about this error but nothing works so far. Annoying thing about the FilePicker is it actually doesn't go most of the time to the designated folder that's been set up. Seems like a bug and probably annoying to the user especially if they just saved a text file to Documents and then want to save a PNG and it opens again to Documents when it should open to the Pictures library. Any thoughts on this?

Posts

  • BrianConradBrianConrad USMember ✭✭✭

    I wound up shipping a PCL version. Only the Android .NET didn't have problems but I can't have multiple code bases. There were problems both with iOS and UWP. I would take some sleuthing to figure out which plugin is causing the problem because it isn't always that obvious in the error logs.

    As it is VS 2017 is still messing up icons on iOS. The manifest interface is just plain broken. It can't seem to get icon locations right so you not only need to fix Info.plist in the XML editor but also check the project file and make corrections. Big time waster. Also if you change the orientation settings in the special editor they don't get changed in the Info.plist. So that also needs to be done manually.

    Submitting the UWP app to the Microsoft Store and running the submission test locally results in a failure. This happened the last time I submitted an app there and suggestions here were to just submit it to the store anyway and it would pass which it did. Seems to be a permissions thing according to the errors thrown (can't find the icons but nothing has changed with those).

    Those are just a few things that can be stumbling blocks unless you are doing just a simple app like a restaurant menu. My app was intended for users who used my Windows PC app to do the same things mobile and that's much more complex.

Sign In or Register to comment.