Saturday, May 04, 2019

Migrating to Android–an early trip report

One of the reasons I held on to my Windows Phone as long as I did is that it was so easy to program apps for it. I had come to depend on one particular app I wrote to help with with the rotating schedule we run where I teach. I finally gave it (too many apps I could not run on the Windows Phone) and got a Google Pixel. Programming an iPhone would mean I also have to buy a Mac and that was a bridge far to far for me. Of course the first thing I wanted to do was to migrate my app to the Android platform. Visual Studio, Xamarin, and C# seemed the way to go.

The code and logic moved almost transparently. The user interface not so much.

One thing that complicates things is that the tools change so quickly. UI code that I created with Visual Studio 2019 Preview seems different from what was created by Visual Studio 2017. This also means that a lot of videos and tutorials are already aged out of usefulness for me. I’m still looking for some videos that work both with beginners to the Android API and Visual Studio 2019.

I finally got something working. It’s ugly but it works. The next step is to learn how to do decent screen design with the Android API. It is not as intuitive as Windows Forms was/is. Not even close. I feel like I am back in the 1980s. It feels like we are regressing in making user interface programming.

At least we still separate form and function. As long as the UI objects have the same names all my C# code seems to work quite nicely. This wasn’t the case in the 1970s and early 1980s. Back then UI code was usually integral with the logic code. That changed over time and the idea of separating form and function moved from new to controversial to the way things were done. It’s the idea that lead to front end and back end developers. But I digress.

Being able to drag objects where ever I want them is a wonderful thing about Windows Forms Design. Microsoft seems to be moving away from that easy to use tool to making programmers write more code by hand. I’m not a fan. Like I said, a return to the distant past.

At this point I have confirmed that coding Android apps is easy and all my C# knowledge is still usable. I’ve also confirmed that I have a lot to learn about creating an Android UI. I’m starting to look for a good book or some up to date videos that are not just marketing demos. Marketing videos focus on showing off features rather than teaching. Teaching videos are a completely different emphasis.

Anyone want to recommend a book or a set of videos that worked for them?

2 comments:

  1. Garth2:56 PM

    I started dabbling in Android Studio. It is drag and drop for the GUI which makes it tempting. If I have the time I would like to go farther with it. I also do not have the computers to do a good job of running AS. The simulator is very slow on the computers I have available. I have talked to some teachers using AS and they agree, it takes some horse power to run AS properly. I am working on that. There is quite a bit of free help out there to get started in AS but is seems to be absolute beginner then jumps the in between stuff to pro level. I am still digging. If you want to build apps that seems to be the way to go. I looked at Zamarin and could not even find a beginner tutorial. Let me know what you found. I would like to see how the C# path works compared to AS.

    ReplyDelete
  2. I use AppInventor with my mobile applications course. Well I did last year. Too many of my students have iPhones which was a problem. If they have good support for iPhones for the fall I may stick with it in school. I'm following some developments at Thunkable which already somewhat supports iPhones. I make a decision in August.


    But block programming is not for me and my personal projects. I'm going to play a little with Android Studio. We'll see I guess.

    ReplyDelete