Developer’s Life 04-05.03.2018

Today I’ve been multitasking a little bit. I had some Real World tasks, some gathering with friends, but the point of these series of posts is to talk mostly about programming so here we go:

Today I moved some logic of my “Breathe In” to the iOS (Swift) version. The first thing is to get the area of the map you are currently viewing and second – load the sensors from my server using this rectangle. The database, model and data access Swift code was generated with my GenerateApp Tool. So for this day/night I got stuck on some error about inserting new records in the database. That’s why for now I cannot say with 100% certainty that the generated code is working. I’ll find that out the next several days when I continue the fight with the technical stuff (the most annoying and not-so-creative part of the programming).

Second I progressed a little bit with the Xamarin Generator. Here I will describe some things a found from the days before:
– I am using Visual Studio, so, The IDE does not automatically adds (for good or for bad) the newly generated files from the files system, only does added to the solution. This was good so I could syntactically correct the generator gradually.
– Xamarin / Microsoft uses Model View View Model pattern of arranging the code. I like it.
– When I added the views (XML, C#, XAML) the IDE didn’t compile the views to the appropriate partial class code ( another cool thing in c# ) and the code file was whining about “InitializeComponent” not being defined. Then I found the solution on stackoverflow:  https://stackoverflow.com/questions/28818525/xamarin-forms-initializecomponent-doesnt-exist-when-creating-a-new-page
The solution was to select the view files, right(secondary) button – properties and setting the properties:
Build Action to Embedded Resource
Custom Tool to MSBuild:UpdateDesignTimeXaml
– Another cool things that I like in the way the code is structured in Xamarin is that you can write the stuff to be asynchronous. This is very important pattern in programming UIs, because you don’t want to have sludgy applications that hang. The other thing is the Publish-Subscribe mechanism of separating components and logic without direct object references.

The third thing I worked today was on NativeScript Plain JavaScript code. The generator outputs some code but is far for complete for now. I am currently creating a prototype app that will be used to create the generator. NS uses pattern similar to MVVM found in Xamarin. JavaScript and the SQLite API is very asynchronous that is theoretically a good thing but a little bit too asynchronous for my taste. Lets see how much it will take me to work it out. I’ll write the findings about the framework and the quirks I encounter once I verify that my codes works on some future posts.

That is all for today. Good night.

Share
Add comment