2019-07-17 20:54:49

hello! How you go for creating the app for Xamarin in visual Studio? The toolbox there is totally inaccessible!
Can anyone lecture me on that topic?
Thanks

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-07-20 19:44:11 (edited by Rastislav Kish 2019-07-20 19:45:13)

Hi there,
well, could you concretize a bit what is inaccessible?
I have developed few applications in Xamarin for Android from traditional apps with a normal user interface to audiogames relying just on gestures and I hadn't any problems with accessibility.

Best regards

Rastislav

2019-07-20 23:22:54

When I forecample select a textbox control, I don'tr know what to do, how to select its properties ETC.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-07-21 02:29:15 (edited by Rastislav Kish 2019-07-21 02:34:31)

Do you mean the visual designer?
Well, it isn't used very widely, even by sighted devs. Guis are rather designed in xml files, which define components layout and their properties.
Every layout has a class behind it, which defines its functionality e.g. methods called on buttons press, data context, special events covering etc. This class is called codebehind.
So each activity has:
- A class normally with the same name as the activity, which contains the codebehind,
- A xml file, defining layout of the activity.

If you used wpf before, this could be very familiar to you. Or html, although html & css is a bit different gui coding approach when compared to android various types of layouts - linearlayout, relativelayout, etc. But the general idea is very similar.

Only question is, if you work with Xamarin cross-platform project & Xamarin forms or a Xamarin Android project using android native layouts.
Android layout xmls have completely different syntax than Xamarin forms xmls, although both results in a native view.

Best regards

Rastislav

2019-07-21 08:36:43

I use only Android projects. I don't intend on targeting IOS never ever.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-07-22 02:19:17 (edited by Rastislav Kish 2019-07-22 02:21:15)

Heh, we are of the same mind. smile
Okay, so here are few resources, that could be useful to you. I haven't time to write full android layouts tutorial here, so I'll just name few places, which could keep you going.
But before, I don't know if you have any experiences with android apps development, so will recapitulate it in a short.
1. Android graphical interface is composed of activities. In most cases activity=window in Windows terminology.
When you create a new Xamarin Android project, you have a MainActivity.cs file there, that is the file containing class of the activity called MainActivity. For some reason this activity is main, therefore it will start immediately after launch of your app.

2. Every activity has its lifecycle i.e. various stages, which start or end is indicated by events. These stages are for example creation of activity, that is the OnCreate method overrided by default, which as you can see contains loading of the layout style and displaying it, paused stage, when the activity is hidden, and you can detect it with OnPause and OnResume (or something like that), destroy stage, when the activity gets destroyed.
These are just few examples, you can read more about it by searching for activity lifecycle.

3. An activity, in case it has a graphical interface, usually contains a layout file (activity_main.xml or activity_main.axml in case of xamarin, you can find it in resources/layout/). This file defines, what will be the activity composed of, and how it will look like.
But be careful here, in this case layout has a bit more practical meaning, than one might expect. It isn't just a name for the xml file, or a term to describe activity design, but layouts are on android also containers, which help you to place components in a specific way. For example, linear layout will position everything you put in in a line. One object beside another. Relative layout will position items in it in relation to each other i.e. you specify where is a button in relation to edit field (TextBox on android), instead of setting their position individually.
Each layout is more or less suitable for certain situation and while your activity's design can consist just from one layout, it is also no problem to dive one layout into another, for example to use relative layout in a linear layout or vice versa, and use that way the best layout for every part of the activity.

4. Xamarin has a great wrapper for android java libraries. It is used for example if you create new Android Xamarin project, that AppCompatActivity class, which is parent of the MainActivity, is a Java class, which you just use from C#. Basically the Android namespace contains all of these libraries, that is how you can recognize them. All of those usings starting with Android (Android.App, Android.OS, etc.) are android java libraries and there are also few namespaces for Java itself, if I remember right, although I haven't used them much.
The reason why i write this is, that if you're searching how to solve some problem, for example how to show a messagebox, and you aren't able to find the answer for Xamarin, you can search for native android java solutions, and then use them without any problems, because the syntax will be very similar as used libraries and classes are the same. I do this rather primarily than searching for Xamarin solution first, Java has longer history on Android, thus there are more questions asked and higher probability, that you'll find what you're looking for.

That's all for the short recapitulation. smile

Now as I promised, here is how to get important informations.
I have read a nice article about android layouts - how they work, why they're useful and what types of layouts are there some time ago:
https://medium.com/androiddevelopers/la … 5a4b4fe32c
You can get an image on what to expect from the most used layouts.
Then, when you want to finally get some, just search for articles from android developers (website). For example, when you write "relative layout" to Google, it's immediately the first result, as developer.android.com is the official Android documentation for devs, with high page rank. Xamarin makes no changes in Android xmls syntax, so everything you'll read there is usable in the original form.
There are quite good descriptions as well as examples, so it shouldn't be problem to study it.

And finally, how to write codebehind? React on Button presses, change text in TextViews etc.?
You could surely find articles for this as well. But at least for me, better choice than thousand words here is one simple example.
Thus I give here as a reference my test project:
http://leteckaposta.co/file/451953945.1 … 6e47103/cs
It is a simple application with TextView, TextBox and Button. You can type something in the TextBox and after clicking on Ok, it'll be spoken by your speech synthesis.
Nothing complicated, but it contains the most critical functionality, which you'll use in every gui based android app.

And I think, that it's all. smile
Of course there is much more to study on Android, but only in case you need a specific functionality, for example services. You will probably use things mentioned above in most of the time.

Anyway, I wish you good luck. smile

Best regards

Rastislav

2019-07-22 12:24:24

Oh lol, that's alot of info. I have never developed anything for mobile, so maybe this is why it seems to be so ovehwhelming. But I will try and study it in great detail

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-07-22 17:39:19

Hi Guys! Just a quick question for you< is there an accessible way for developing android apps like games etc_ Sithg people have many programs for creating Android contents but, is there something for blind people_

Claudio

2019-07-22 20:10:30

@7: heh yes, it may be bit overwhelming for first time, especially if you weren't developing guis using xml before. But it's very easy to get used to it and it saves lots of work with designing interface.
The amount of informations is why I personally prefer examples, it's always good to see how things are used while reading about them.

@8: this whole discussion is about one possibility - Xamarin, which allows you to develop Android or even multiplatform apps if you want in C#, so you can use the entire .net framework when developing. And by entire I mean entire, you can use everything from C# Streams, through its subprocessing libraries to Linq with its various providers like System.Xml.Linq allowing you to read xml files very efficiently.
I found this very useful when developing games, Java, what is the Android primary language doesn't even have a Timer class, so you must make it yourself by launching delayed tasks, what is... very very ugly looking solution.
C# of course has System.Timers.Timer, with very elegant usage, so it's trivial to use it in a game.

There are also various other possibilities, which you can use, like AndroidStudio & Java, Kotlin, or even Flutter & Dart, although there are not many libraries for Dart yet.

And you can develop even in C++ if you want, although I don't recommend it at all. big_smile

Best regards

Rastislav