2021-04-08 19:30:03

Hy there, fellow developers, programmers, builders, whatever sad!
So, as you already know, since I gave up bgt as a dead horse despite making some libs for it by then, I too, like some others here, jumped on the c# bandwagon. I didn't very much like ms back then, as I don't really even now, however the language sintax was familiar to me, the ecosystem sounded great(well, it still kinda is today), it integrated with the windows API in a very friendly object oriented way(remember, no .net core when I enrolled), some others too, but I think you got the picture already.
Maybe I didn't mention it on this forum, but I was always passionate about creating mobile apps and actually got into programming specifically for this thing, so I was searching to apply my existing c# knowledge to the mobile dev field, well, it seemns I got more than I barggined for, so here it goes, xamarin.forms.
For those of you who didn't read my previous huge post about this matter, xamarin.forms strives to bring the .net platform to mobile devices, be it android, iOS, or even windows phone 10. It manages to do so by employing native controls for the UI made with it, thus being kinda faster and more accessible besides giving the intended sentiment, the app won't look out of place on any platform x.f supports.
Plus, what convinced me to try xamarin.forms was the way of writing UI in xaml, an easier way for blind people to write and imagine UI, as a hierarchical structure of nodes, plus parent layouts automatically size and position the children controls according to the person's specifications. Of course it won't be the most stunning UI ever, however I still had a chance to not make the controls overlap or other weird side effects, like not enough space in the window for the contents of a list or a textbox, or even the layout of the thing looking ugly and made by someone who's not caring about his UI look and user experience at all.
Well, all that is good, but in their strive to make everything as native to the platforms as possible, they arrived  to some compromises and decisions that have consequences I don't like as a blind developer, and I bet my intended audience, mostly blind users, won't like it that much either.
First thing, accessibility. You might wander how can it be possible to do something less accessible than the platform provides while you're using the native controlls, well, only microsoft knows what microsoft does, tbh. Now, let's describe the problem a little, shall we?
So, first thing, navigation is fucked as hell. For example, on android, if you have an app with two or more pages(screens) and you navigate between the first and another one, guess what, the back button is unlabeled and I can't, unless I delve deep in the internals, change that. Plus, on windows it's even worse, the screen reader doesn't even focuse on the back button, it only says grafic and so on. Furthermore, when you navigate to a page, focus isn't placed anywhere, so the user practically doesn't know they are interacting with a new screen entirely.
There are lots of issues with this alone, I even opened an issue against them, not even an answer, maybe some bots self asigned, but nothing more.
Now, to some more seriously bad design choices.
You know the settings screen any moderately large mobile or desktop app has to eventually get? The xamarin.forms guys recommend we implement that with table views, a special data presentation view, like a grid basically, there are some user modifyable cels there.
Anyways, the android version of it is just deplorable from both a visual and accessibility standpoint, I think. So, from a rendering and layout and screen reader interaction side, for checkboxes, there is first the text, then the checkbox, terrible design. Next, the settings sections(categories) aren't marked properly, just a lable among all those cels, doesn't make much sense to a screen reader user, believe me. As if the trubbles can't ever end, the edit box cels are kinda inaccessible, the keyboard doesn't show when tapping on it like a normal edit box would, though talkback says cursor to the end and all that. Only when you long press on the thing, you might get lucky and get that fucking keyboard finally, but then something else happens, and so on. This is all I'm saying, it's needless to speak about uwp, the cels aren't even read. I would like to share the uwp version as well, but it's farely large, wetransfer won't accept it, plus my google drive is kinda full.
However, if you want to see the android app for your self, here's the demo apk
https://we.tl/t-IWNPksaqCg
Besides, it has some stupid limitations, like the app can't do anything if it's in the background, can't do notifications, nothing of that kind of thing, so not really native, not at all. Plus, if you want to use a checkbox in your app, you have to make a grid with two columns or something, you must put a label next to the checkbox to explain it, like the text we get to set on almost every OS besides iOS, same with the switch control, I wander how is it that edit boxes don't need to have the same treatment?
So, all in all, I'm fed up with this xamarin.forms thingi and I am considering two options at the moment, For those of you who are more experienced, please advice me on what to do next, maybe this is one of those forcs in my programming life, hobby, whatever.
First option is continuing to develop with .net and c#, but use the native platform layers of xamarin to develop with each platform's API, like xamarin.android and the microsoft uwp sdk. With this approach, I might get a bit of a different UI for each platform, which I don't consider so bad, even though I would still have the common business logic in a class library. Advantages can be that I know c# and the dotnet tooling to some extent already, so the learning curve won't be that steep. I would have to learn each platform api with their unique ways of doing things however, but a bit of learning won't break a brain, right?
Next, another cross-platform framework, though almost reacher than xamarin in features, react native. Advantages can include that all is as cross-platform as possible again, so my code would be more portable and whatnot. Another one can be that I have a full set of API's dedicated to accessibility, a deeper one than xamarin currently has to be sure. A more important one is that I could instantly see changes applyed to my project on a device in realtime, on the device itself, the hot reload backed by expo is more powerful than what xamarin currently has.
Disadvantages are some too, for example I never worked with too much javascript, I feel as if I won't really recognise it if you gave me a file you say has javascript code. Besides, node.js is completely alien to me, as well as its package manager(npm), so I DK if I would have enough libraries and sdks as I do in .net world with nuget. Then, I think visual studio support is meh at best, please correct me if I'm wrong.
Now, I ask you guys, what do you think would be the better corse to take, go native with c# and platform-specific UI, or learn the react native framework and get a better grasp on javascript? If you'd recommend the latter, where would you recommend me learn javascrypt that isn't very browser tainted, as well as the paradigms it uses in order to be able to better understand react native documentation?

Thumbs up

2021-04-08 20:39:54

You maybe want Dart.  I haven't tried it but I've heard good things.  If they finish desktop accessibility I'll probably head in that direction, but maybe it will suck.  Perhaps Chrisnorman7 will see this thread and tell us how this is done in Dart land, and if Dart does this kind of thing as well.  Going native and trying to write a cross-platform UI with C# is going to be much much harder than you think.  Rewriting your UI for every platform means that every time you add a feature you have to redo it 3 times or 5 times or whatever instead of just once, and will slow you down by 3 times or 5 times or whatever (and god help you if you architect it wrong because your refactors will also need to be done 3 times or 5 times or whatever, because I promise no one else will be able to).

React Native is a good option for phones.  React Native for desktop is still kind of beta quality.  I Don't know how good Windows accessibility is, but there are still open issues.

Avoid Expo like the plague.  You can easily do without, and I've never heard anything good about it.  One of my friends literally lost two weeks once because he went beyond the capabilities of what it offers, and found out that their procedure for getting your app off expo was buggy as hell.  You will find enough SDKs and stuff though, yes.

Most non-Microsoft tech will not integrate with Visual Studio, but VSCode is incredibly popular, and modulo the word navigation bug pretty nice.  VSCode integrates with basically everything you could want.

I'm curious: Xamarin works on desktop but is broken on phones?  or it's broken everywhere?  You used to advocate for this a lot.  They'll probably be more responsive once the migration to maui is done.  If you can get issues in front of the right people they do seem to listen these days.  But it sounds like what they've done isn't exposing native controls as you have to for accessibility at all, so maybe it actually cant' be fixed--if the official way to label your checkboxes is to use a separate control, you can't just do the accessibility API and be done with it.

My Blog
Twitter: @ajhicks1992

2021-04-08 20:58:41

Wait for MA Ui. BTW, Xamarin.Forms was never intended for developing production-ready software. Xamarin>Forms is more of a prototyping framework or a small software which does not require deep native integration. Accessibility is one of the things which does require deep native integration, and so Xamarin.Forms is not a good option for such thing.

I am a ripoff of my mother,
and my mother is a ripoff of my grandmother.
We're all bitching about game clones,
and by generations of generations, we're based off stolen code.

2021-04-08 21:28:37

@3
That is contrary to literally everything their documentation says.  I'm not sure where you got that claim.  Do you have a source?

Also you don't need native integration to do accessibility.  You just need the library developer to care enough to do it for you.  It is entirely possible to get this working without even using native controls, which is what Flutter has done.

My Blog
Twitter: @ajhicks1992

2021-04-09 03:10:39

Hy guys!
sorry for posting that late, this forum gave me a tun of errors before I could post it, so this is the 7'th time, hope it doesn't break again. As a sidenote, I really think this forum is gonna die someday, so web crawlers should be deployed soon.
@2 well, I DK about dart, never tryed it before, but I also herd some good stuff about flooder with it, so DK at this point. Now, xamarin.forms has some accessibility issues, DK, they didn't consider accessibility at all. Well, they give you native controls, as long as they are supported by all platforms.
For example, iOS, they say, doesn't have a checkbox control, so they draw it themselfs somehow. If this is accessible or not, I honestly DK, since I don't have a mac to build any form of ipa file, even if unsigned, not that github actions wanted to help me one bit with those toolchains being configured, or I DK how to do it properly.
Now, let me tell you why I think they have this big problem with navigation in pages.
So, as you android programmers who happen to read this thread might know, activities are the building blocks of any android application, they are your app's different screens, or pages, or dialogs or whatever. For example, each time you tap an option in the settings app and you get that navigate up button then other things under it, know that's a separate screen, and such, a separate activity with its own lifecycle, etc. As you again know, only one activity can be shown on a screen at once, so the app must somehow switch between them, android has a system for this that operates on intents. Thing is, when such an intent is sent, it has a specific format and payload attached to tell the OS to start a new activity and exactly which, like an absolute path for a file. Guess who's the first to be notified of such an event, who is looking exactly for such things among others? Guessed right indeed, the accessibility services. When such an intent is fired, the accessibility gets what's gonna happen, so it prepairs itself to begin reading a new screen, focusing at the beginning of the page and all that.
Now, not many people know this, but there's something else that look on the surface like activities, but they should serve a different purpose, I guess ms skipped this at all. Yeah, I am talking about fragments, of course.
A fragment is like an activity, with its own lifecycle and layout to render on the screen, however it's not an activity. The key thing here is that, in stead of making your app pop up hole activities whenever a little change of several controls is required, you could just change one of the fragments. So, each activity should be made up of different fragments with their own layout tree,  representing functionally a single group of controls, a component. So, by this design, every activity should be **composed** out of multiple lightweight, fast and swapable fragments, opening up a hole lot of possibilities for dynamic UI and behavioural changes on the fly.
Well, as I said above, microsoft does what microsoft wants, and again, it fucked the thing up, yay! So, in stead of new activities being created for each navigation page instance, only a fragment is being created and populated with the controls. Now, because fragments don't have and won't need a go back function since they shouldn't be used in this way, microsoft didn't think and go back on it, rather they decided to draw their own back button, plus make a navigation stack to store the order pages were navigated to and so on. Just a little bit of reinventing the wheel, don't you think? And for nothing less than in the name of lightweightness, performance and faster startup time hahaha! I mean, OK, how big are xamarin apps already? Gonna tell ya, pretty big, both storage and memory. How long would it take to instantiate an activity and populate it with elements and let fucking android deal with the stack and all that? Well, considering the jvm>jni>mono(clr) delay, no more than 10 ms from a midrange phone, so I honestly don't see what's the deal here, I guess overengineering can be bad sometimes?
I am kinda lazy to go digg through the open source code we have to see what is it using for uwp and iOS, but for uwp, I herd it's using frames/panels, another fragment like concept, the same flaws like in android, however the back button is not even clickable by a blind person with accessibility, it's announced as grafic and ocr says content not visible, isn't that great?
Now, it is broken both in the desktop and mobile realms, but it can be worse in uwp. Actually, regarding your afirmation, yeah, I was advocating for it in the past, honestly if these bugs and horiblenesses weren't present, it would still be my favourite way of making cross platform apps. Actually, whatever I'll do in the future(probably cyber security work somewhere), I will always find the .net ecosystem great and almost, and I said almost, allfulfilling in any situation. Plus, you don't have something in the standard library, sure there must be something for your need somewhere in the .net package manager, nuget.
I know .net isn't xamarin, so I'm not holding the entire ecosystem at fault for bad decisions taken everywhere throughout the framework's history. Seriously now, xamarin put me on edge, their unwillingness to fix it even though multiple people reported something similar, even when I posted an issue is more and more worsening my mood towards them.
Btw, it seemns you're well informed indeed, how did you come to know about maui, you got me surprised there. Yeah, I could wait, I don't have other projects besides that app that's already on github and already using xamarin.forms, so nothing for it but to go on as it always was. However, what if this doesn't get fixed? What if it is exactly the same? DK, I might try it out when it's more stable, but by then, one way or another, I think I would have made my decision already.
So yeah, if you guys recommend react native, where can I get a browser neutral version of javascript to be able to learn the syntax and paradigms, since god damn it supports many.
Btw, if I don't use expo, would I still get that shared project, or only android and uwp and whatever else specific code, and no shared project or whatever at all? Is expo simplifying things, or actually complicating them?
I still DK what I'll do, but I feel the decision point is nearing by the day, only have to figure out what the hell is vscode and how to use it, then what do I need for react native development. Gods, I feel like I'm trying to learn python by making audiogames, but can one learn the node flavour of javascrypt otherwise?

Thumbs up

2021-04-09 08:09:22

@Camlorn Of course, I might be misunderstanding some of the subtleties, sorry!
But from what I have researched, because Xamarin.Forms is intended to create a fully crossplatform codebase, they had to give up some functionality on it, like calling the native JAVA API on Android. This can be done with Xamarin.Android though.
Sorry if I am wrong. I never thought much about mobile dev, I was just interested and read.

I am a ripoff of my mother,
and my mother is a ripoff of my grandmother.
We're all bitching about game clones,
and by generations of generations, we're based off stolen code.

2021-04-09 15:55:55

I don't know what the state of Flutter on Android is, but on the iOS side it currently has some pretty major issues. You can see them if you go through their git, but the most serious one that comes to mind is that their edit fields have no accessibility support while editing. So when you tap on the text field to edit it, you can type and touching it again will read the new value, but the VoiceOver cursor movement commands won't work and you won't be able to read anything while you type or backspace. So for simple apps it'd probably be fine, but for more complex interfaces you'll run into issues

<Insert passage from "The Book Of Chrome" here>

Thumbs up

2021-04-09 16:00:31

@7
I believe that has been fixed. authpass(Password manager that is written in flutter) used to have this problem but when the developer built it again using a newer flutter version it worked fine and as you would expect

aliquando solem e caelo capiam, et libere volabit anima mea

Thumbs up

2021-04-10 18:03:23

@5
Yeah, I know about maui because wen I criticize things I do actually learn about them first.  And honestly at the moment most of the things you're saying are fulfilled by all the other platforms too, for what that's worth.  You're not actually saying anything that's a unique strength of .net.  I'm maybe for .net 6 overall as it does look like they may finally have made the CLI tooling not shit, but we'll have to wait and see.  I wouldn't call Xamarin not .net though, being as either Xamarin is becoming Maui or being deprecated in favor of Maui or who even knows--it's unclear what the relationship between those codebases is from the public announcements, just that we're encouraging everyone to move to Maui.  But in any case I expect the Xamarin people are winding down their development.  And, it's probably worth noting that I *want* to like C#.  I' just not willing to be tied to a company with a track record of breaking accessibility (which you're literally seeing right now) without a way to get out, which prior to .net 6 was the status quo.  I won't let my software be destroyed by the accessibility rug getting yanked from under me, and if it weren't for that I'd be seriously considering the platform myself.

Expo is just a convenient newbie way to do react native.  You can get most (probably all) of what it does easily without it.  You can get the normal react going cross-browser with, I think it's called create-react-app.  There's basically a JS build step that compiles modern JS to  aversion of JS that all browsers support.  But you probably want Typescript, which does the same thing but with types.  React native uses different jsx tags and isn't standard HTML, however.  You don't just grab web HTML and throw it on the device.

@6
Yeah, so the thing is almost everyone doing mobile apps nowadays uses stuff like Xamarin where you give up the ability to call native APIs in favor of a cross-platform UI.  There's usually some way to hook an extension in that you write in Java or whatever to get that back.  But the thing is that 99% of people doing apps literally only need the ability to display text and pictures, make HTTP requests/do networking, and access the camera and microphone.  The only real exceptions to that are games (cross-platform solutions are too slow/you need native level access for graphics) and weird one-off things.

React Native isn't meaningfully different from Xamarin when it comes to this stuff.  Nor is Dart.

@7
I wonder if @chrisnorman7 knows about that.  He's the primary one saying it's good, but I think maybe has only done Android.  I kind of support it because I'm literally watching them do desktop accessibility as we speak, faster than I've ever seen anyone bother, and it seems to me that if you've got a blind dev saying it's good and are watching them move that quickly on an accessibility implementation, they're likely doing something right.  But I haven't evaluated it myself so maybe it's secretly terrible on iOS, or maybe Chris hasn't done a really complicated UI, or any of a number of other things.

My Blog
Twitter: @ajhicks1992

2021-04-10 21:33:23

@9, I've actually been considering diving back into C# and .NET -- the newest features look really neat. Just not sure about the UI stuff.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

Thumbs up

2021-04-10 21:46:26

@10
Winforms works.  WPF and UWP work, at least to the extent that you'll have something as accessible as (say) the Windows settings dialogs.  .net 6 makes the dotnet cli utility able to do all the workloads and VSCode supposedly supports debugging.  But I hesitate because the official way to do builds is to edit msbuild files still, and until .net 6 has been around for a while and proves that you can live without VS I'm not willing to do it (VS is the only thing that fully understands msbuild, including developers at Microsoft, according to my friend who works there--even internally it's everyone has to go to the specific experts to understand how the build system works).  VS supposedly got better but as I said--well, I was around for 2010.  And people still complain about NVDA lag all the time with it.

But my mmo thing might use it as a frontend over Rust, if I ever get that far--a year is my timeline, a year is really a long time in programmer land, and they appear to at least be moving in the right direction.

My Blog
Twitter: @ajhicks1992

2021-04-11 10:41:28

Winforms is good, atleast for blind-accessible software. I do not understand why people are bashing Winforms so much.
XAML never appealed to me much, even thoguh I am a huge fan of .NET, C# and their flow.

I am a ripoff of my mother,
and my mother is a ripoff of my grandmother.
We're all bitching about game clones,
and by generations of generations, we're based off stolen code.

2021-04-11 13:01:59 (edited by vortex1024 2021-04-11 13:04:42)

if you truley want cross platform, I think dart is what I would recommend, to. I talked with another blind dev, and he said android works. Ios is still unknown. It also seems it is faster than xamarin.forms, which is quite slow and not really recommended for big projects. Not officially, but most people which have worked with it think like that. Dart is also closer to c# than javascript, and closer to common sense in general, if you ask me. smile
On the other side, if you don't dislike js, react native  might be a wise move. you could then transit to Node, angular and company which aare very popular technologies, and will give you big advantages in the workfield.
If you want android only though, xamarin + native interface works great.

@12. times have changed, people want software to look beautiful and work cross platform. Winforms doesn't meet those requirements. Yes, it works great for personal projects, learning,  and internal company software, but not much more.

Thumbs up

2021-04-11 15:13:25

@12: we bash it left, right and center because, first, winforms is by all intents and purposes kinda dead, replaced by wpf in normal desktop land, and uwp in modern win10 land.
Then, every UI you build with it is gonna be done in code which is...umm...not that good and kinda eww, don't you think?
Next, you have to use the vs designer or code it by hand, neither of which are really good. I mean, both approaches are as accessible as humanly can be, but you just can't really tell where you're putting the controls without some serious calculations. As for dynamic content, I suggest you make that app blind and visually impaired only, since controls are going to overlap in weird ways, or the window might be just too small for what you're trying to display, which from a screen reader perspective is good, but you absolutely don't want to know how it looks visually to imagine just how much of a bad idea. it is to use winforms nowadays.
@9: I say xamarin itself is not all of .net, since there are good website and game frameworks, authentication services, a built-in database framework which could be good for some but not for me(entity framework), kinda neet logging especially if you use the serralog nuget packages, console apps and things in .net core which don't use xamarin. As a platform, .net core is actually really good, especially now I'm so accustomed to the c# idioms and community and stuff like that.
I am kinda afraid to try other platforms and sdks, not because they don't have package managers, I know most of them do, however I DK what kind of packages and things are supported. For example, in the current project I'm working on for some time now, I need to embed a lua interpretor. Well, in .net land, we have Nlua, a lua binding for .net which uses reflection and code generation to bridge .net and lua as seamless as possible. So, we can put a .net class in the lua environment with a dictionary and the binding does all the work. We can, similarely, extract values from the lua land in our c# scripts as well as call lua functions and get an array with the return values. We can register to a .net event from lua, the list can go on a bit more, but I DK anything else.
So, would I be able to find something similar for javascript/node/react native?
Btw, when I mean browser agnostic javascript, I don't mean the subset that can run on any browser, I mean the javascript that would help me learn react, the kind that's used for node.js and such. I mean, each time I try to learn js, I get only browser based articles, like all that document.getElementById or however the js conventions are. This happens so much that I DK what's plane javascript and what's browser stuff anymore. Put more concisely, I DK what to expect from that kind of slimmed down javascript or typescript we have at our disposal in react native, in comparison to the one we find in browsers.
As far as I know, the .net command has build and test subcommands which will automatically build projects and run tests in the command line. With .net watch, you can bring it further, triggering the build once a file or a group of files changed, like, you edited them in vscode or whatever, you saved them, and the .net toolchain performs an automatic build. Alternatively, it could perform a check, that means kinda a linting each time something changes. So, the cli is kinda powerful already, I'm excited for .net 6 already. However, for cross platform mobile UI development, I won't use xamarin anymore, don't think maui will be better, but we'll see.
@10, I recommend you go for it, however don't touch xamarin with a finger because you'll like it, then when you realise the problems, you'll also realise it's kinda too late since you begun this ambicious project and you can't migrate the code so you have to deal with it and all that.
I forgot, I DK how accessible it might be, but there is a .net core UI library that suppozidly works on windows, linux and mac OS already, it's called avalonia UI. Here it is:
https://avaloniaui.net/
Again, didn't test it for accessibility, but I think it should be fine, as it says it uses as backends native UI to each platform it supports.

Thumbs up

2021-04-11 18:48:16

@12
You haven't done big enough UIs to understand why UI in code doesn't scale, but UI in code is incredibly difficult for anything even remotely complicated.

Mind you, jsx is much better.  Xaml kind of came out very enterprise, and it's harder than it needs to be.  But still better than doing it by myWindow.addControl(myButton) or whatever.

@14
Seriously, you're saying "I like .net because I haven't learned anything else".  I'm not sure you realize that.  I think the only thing you just mentioned that's not available in any other of the big platforms is nlua, and even then almost every language that exists has a Lua binding and it's just a question of if that Lua binding is that good/automatic, and some of them definitely are.  But you're making arguments that are roughly ".net is better because it has a for loop" or something.  It might be a good option for cross-platform games if only because there aren't that many things that have a chance of producing a cross-platform UI that's accessible, and it *might* be one of them, and because React Native doesn't have good audio options for the phones.  But your fear here is unfounded.  It's not like all the people using something else went "huh, let's not bother with logging" or something.  There are different philosophies behind it, for example JS is about small packages that you put together yourself, but honestly on the whole I think you're going to find that most other things are actually easier than C# because Microsoft targets the enterprise crowd, and the enterprise crowd needs their hammer to also be a saw with beer opening attachment and doesn't care whether or not it's easy for a single developer.

I don't really care whether you use it or not, but it's a bit painful to watch you support it in a "I never did anything serious using anything else so this must be the best platform" way.

As for Node, React JS is browser JS.  They just use node to orchestrate a packaging/build step.  If you want to learn non-browser JS you want to specifically look up Node tutorials (for backend) or React Native tutorials (for React Native) but normal browser React runs in the browser and has access to all of it.

My Blog
Twitter: @ajhicks1992

2021-04-11 18:58:25

that’s basically what dart does though. You kind of have to write your user interface in code. Although if there was a specific language to use for interface development(As easy as HTML) that would be a big help in separating user interface and business logic

aliquando solem e caelo capiam, et libere volabit anima mea

Thumbs up

2021-04-11 20:07:13

@16
My understanding is that Dart uses a sort of halfway declarative thing where instead of using HTML tags you use normal code, but you nest things inside of constructors and things like that, so it sort of comes out the same.  XAML/JSX is very convenient and useful, but the core insight is that it's easier to manipulate a UI in a declarative fashion, rebuild it on every update, and then reconcile the trees.

Perhaps Dart pushes more toward imperative rather than functional paradigms, though.  I'm a while away from getting to that part of my projects.

My Blog
Twitter: @ajhicks1992