📜 ⬆️ ⬇️

How a non-programmer created his mobile app

Hi, Habr!

I want to share a story, like me, a non-programmer, was able to write my first mobile application thanks to (or in spite of him) MS Visual Studio 2013 and even publish it in the Windows Phone store. I ask the readers to take into account that I am the most inexperienced non-programmer who can do little in this area, so if I solved some problems not so elegantly as they could be solved, then you shouldn’t mock - this is my first experience in such a matter.

It all started with the fact that while studying at the Cyber ​​Security course at Tallinn University of Technology, I took a VB.NET course as part of working with Windows Forms. Then somewhere I accidentally read that MS Visual Studio 2013 allows you to create mobile applications not only on some mysterious C # or Java for me, but also on VB.NET.
')
“This is a chance - so I’m megaspets in VB.NET” - I thought then. Immediately using the student license, I downloaded MS Visual Studio 2013 and started the mystery of creating my first application.

On the course we were told that the most important thing is not a skill, but an idea. There are a lot of skill programmers, and few successful applications. The same Rovio was bankrupt several times and released hundreds of useless games until it reached Angry Birds. Here I was all right - skill zero (as it turned out later), but I had an idea a long time ago. The idea is simple - like Flappy Bird.

So, I opened MS Visual Studio 2013 - New Project - Visual Basic - Store Apps - Windows Phone - Blank App (Windows Phone).

Here I made my first mistake, later I will explain what it was about.

I opened a phone emulator with an incomprehensible code on the side, and a page with a code similar to VB.NET. Ok - what next? This is not like Forms, something is wrong here you need to read the manuals. How Microsoft turned out to have created the broadest knowledge base to support developers: detailed video tutorials and written manuals, from beginners to professionals.

On these courses, everything is described in detail from how to install a button before contacting the cloud and storing databases there. Here, Microsoft has a great respect from me, even I figured out - they treated their developers very well, it is clear that this is important for them. I started to look, read - I began to understand how it all works, as well as the understanding that this is not Windows Forms and we need to start learning again. Lecturer in the video lessons perfectly told and described in detail all the actions for ... C # (oops, pichalka). But this was enough for me to understand the concept and create a couple of pages with transitions in my application.

Then the nightmare began! A bunch of commands that I used to simply did not exist in VB.NET for Windows Phone, they were replaced with alternative ones! Microsoft, really?

I had to learn the whole syntax from scratch and share one VB.NET and another VB.NET in my head, but for Windows Phone. For example, in VB.NET there is a command for determining / setting the coordinates of an object in space. In Windows Forms, it is:

Image.Left=100 // i=Image.Left // 

On Windows Phone:

 Canvas.SetLeft(Image, i) // Canvas.GetLeft(Image) // 


image

It is very difficult for an inexperienced non-programmer to understand at once why his Image.Left = 100 does not work, because it’s still correct. As a result, you spend time, sometimes a lot, on finding solutions.

Let me give you a couple of examples, maybe someone will be useful if Google brings him here.

Forget everything you knew about Timer. There is no Timer object. But you can create it through code and it is called DispatcherTimer (Microsoft, really?). First you need to create it in code and set an interval:

 DispatcherTimer = New Windows.UI.Xaml.DispatcherTimer() AddHandler DispatcherTimer.Tick, AddressOf dispatcherTimer_Tick DispatcherTimer.Interval = New TimeSpan(0, 0, 0, 0, 10) 

Then create the dispatcherTimer_Tick event - to figure it all out, it took me 2 days. Since direct googling was nothing. Only a cry for help at http://stackoverflow.com led me to the right decision.

After that, I began to read the Microsoft knowledge page more thoughtfully and search for it. Here I began to find the answers myself, since it was made very convenient there - the search solution was provided in several programming languages ​​at the same time. One feels caring for developers, albeit with a bitter aftertaste.

Next, I needed to refer to the web resource where the text file was located in order to take one line from there. It's simple: go and http://msdn.microsoft.com find the right solution, but ... It does not work. No, no, I did something wrong. Erasing everything I do on the new - again a mistake. Commands StreamReader and GetResponse are not recognized. How is it, here they are right on the site of Microsoft! Well, fine, on http://stackoverflow.com they will definitely help me. But there they say that everything is done correctly and should work as it should. Panic and tears! Threw everything for a week.

I came back and I saw one of the Stackoverflow users asked if I’m writing to VB.NET, which is not Silverlight? My first reaction was:

image

What is it all about, what is it, why does it scare me?
It turned out that there is not only VB.Net, VB.Net for Windows Phone, but also VB.Net for Windows Phone (Silverlight), all of which differ in syntax in different degrees.
Microsoft, WTF?

Looking carefully at http://msdn.microsoft.com, I saw that almost everything described there was all for Silverlight and I was just lucky that the syntax was less or less the same. I made this mistake when creating my project, as I wrote above - I chose the Balnk App (Windows Phone), and not the Balnk App (Windows Phone Silverlight).

Quit and start all over again? No, too many sleepless nights were killed to create what we have and I decided not to give up.

With a long googling and walking on forums of various spills, I found solutions for reading text from a file that lies on the Web, who can come in handy:

 Dim httpClient As HttpClient = New HttpClient() Dim form As New MultipartFormDataContent() Dim getUrl As String = "http://website/test.txt" Dim response As HttpResponseMessage = Await httpClient.PostAsync(getUrl, form) responseText = Await response.Content.ReadAsStringAsync() 

Then there was a problem with displaying the message to the user - an elementary MessageBox. In VB.Net (Windows Forms) it is done in one way in VB.Net (Windows Phone) in another, in VB.Net (Windows Phone Silverlight) in third. But we are already adults, accustomed and it does not frighten us. Two nights and a solution found:

 Async Function ShowMyDialog() As Task(Of Boolean) Dim result As Boolean = False Dim dialog As New Windows.UI.Popups.MessageDialog(rl.GetString("Try_again"), rl.GetString("Game_Over")) dialog.Commands.Add(New Windows.UI.Popups.UICommand(rl.GetString("Yes"), Sub(command) //some action End Sub)) dialog.Commands.Add(New Windows.UI.Popups.UICommand(rl.GetString("No"), Sub(command) //some action End Sub)) dialog.DefaultCommandIndex = 0 dialog.CancelCommandIndex = 1 Await dialog.ShowAsync() ' Return result End Function 


Not so easy as you can see. And now, after going through all these jungle coding, I went to the release. Everything was ready, everything worked. I decided to add a banner with advertising, it turned out to be very simple - there is an AdControl tool that is simply customizable. You just need to get a personal code on the site http://advertising.microsoft.com/en/home and that's it. And it turned out that Estonia, where I live, and Russia are not included in the list of countries that can participate in this program. That is, if you do not have a bank account in the list of 35 countries, then, I'm sorry, you are in flight.

Ok, I heard there is the same program from google. Yes, there is Estonia on the list. Fine! Download the addition to MS Visual Studio 2013, we are trying to add a banner to the project and ... it is not among the available tools. How? Why? And because it only works on Silverlight!

Microsoft Google, really?

Again, an error occurred at the beginning. But there is already no power to redo. To realize my plans and become a billionaire in 2 hours, I decided to create 2 applications: Free and Pro versions. It took 1 hour.
Well, everything is ready!

We begin the publication. Everything is simple here: MS Visual Studio 2013 itself runs a couple of tests for fitness and errors, generates a .appxupload file. Which is poured on the page http://dev.windowsphone.com

Then you need to wait for confirmation of certification of the application. I sent the app at 3 am, at 5 am I received confirmation of registration. Pretty quick! However, he immediately found a bug in the application and decided to fix it. After that, I decided to download the application update and got into a stupor, since there was no button on the application page for uploading a new .appxload-file. But how to upgrade? It turned out just - you need to click here:

image

Go guess.

UPD: While writing the article - already repaired. Promptly!

image

However, it is still impossible to read some data in the dashboard:

image

Total


In general, Microsoft has created an excellent platform for creating mobile applications for Windows Phone, Android and iOS. Even if Krivoruk inexperienced non-programmer was able to create his own application with it, then the skill here is knee-deep. Through swearing and tears, thanks to my stubborn obstinacy and the desire to make my dreams come true, I managed to reach the finish. If you possess skills in at least some language supported by MS Visual Studio 2013, then drop everything and sit down to write your mobile application. I am sure you will reach your goal, even if you have to go through pain and despair.

Source: https://habr.com/ru/post/243007/


All Articles