Best practice to convert screen design to XML in Android - android

I'll start with the fact that I'm quite new to Android
app development and I came across a real App screen, that I thought will be a good practice to convert to XML.
Although I successfully copied some parts of it, I believe I lack a little bit of knowledge to achieve that goal. So I hope to learn from your answers.
Please keep the answer as clean as possible since I wish to learn forward from it.
Thanks in advance!
NOTE:
1) The icons on the gray line are clickable.
2) the X on the light blue line is clickable and deletes the line.

So, I create for you quick demo app(it is not as good as for commerce practice). How it looks and works from inside you may see here in GitHub repo. Hope I help you!
Things you try to avoid:
hardcoded text & colors in XML
not consistent id-naming
none-dimensional code *, for example like this - android:textSize="16sp"
* - I mean use dimens.xml, for instance - android:textSize="#dimen/default_input_text_size"
I will recommend you read a great book:
Clean Code - Robert Martin
Also, I support #FrancislainyCampos post. You should try to read also about design and develop tools to think and do more consistently with Google recommendations.

Although I've heard of some new tools that proclaim to be able to automate the task of converting design screens to xml, I don't think that's wide spread around the Android community yet. I think the best tip for you here is just to actually type each element on the screen not converting it but making the layout happen. There's a few tutorials on how to use Constrainst Layout to achieve that on Youtube. I'd also suggest this course here on Udacity that explains the step by step on creating your first screens for Android.
Hope that helps.

Related

Display algebraic equations that look as nice as Tex in TextViews in Android Studio?

I spent like a half hour researching and many suggestion are either years oudated/no longer existent, and me being a programming beginner who doesn't know how to do more advanced things than basics like adding text/buttons/etc. and basic programming logic into Android Studio activies, I'm totally lost. Some suggestions mention inserting HTML with JavaScript references but I haven't found a guide that explains how to do it, and those making the suggestions listed some cons, too. E.g. How would I display 5^2 (without the '^' and the '5' in superscript form), '1/2' in neat fraction form, etc., in a TextView or whatever other text component? I searched through the Android developer reference as well but didn't see anything that 'intuitively' stood out to me, for the lack of a better word.
You could achieve this by using WebView and JS. An example of such library for Android is: https://github.com/KaTeX/KaTeX.
I think you can use MathJax for doing that. Please refer to this GitHub repository.
MathJax

Styling Custom Dialogs

Is there any way, specifically in android studio, to see what one's custom dialog would look like without actually running the application? It seems that the Design view of layouts account only for entire-screen designs. It also seems that sometimes the way the "dialog" looks in the design view is wildly different than the way they look live.
I would share some of my code, I know you guys love that, but this isn't exactly a coding question, is it?
You can use third party tools and mirrors. I think the closest you can get is by checking this out.
This is hot swapping in general and you get interactive previews but like I said it is the closest you can get. I haven't worked thoroughly with it but I think this should be what you are looking for.

Starting point for app creating, where to start

I am looking to start writing apps for mobile devices. I know a little about this subjec, and I am proficient in both java and python. However, before jumping into creating apps I wanted to get the community's input on a question I have not yet found the answer to:
How/Where should I begin?
I understand this question is fairly general/basic for a community that focuses on solving/debugging complex programs, but if there is a recommended tutorial (or specific platform) that will help a beginner(such as myself), it would greatly reduce the frustration and amount of monotonous questions asked on this forum and others.
Regards
Coursera is offering 3 courses all using android development which started last week. That would be an excellent starting point for anyone:
https://www.coursera.org/specialization/mobilecloudcomputing/2
How/Where should I begin?
I don't know about you, but I often learn by example more than reading. You mentioned that you're proficient in java so thats a great start. After you understand the Android SDK it's really only the UI good practices you need to learn. So here's my suggestion.
Start off with something super simple. Let's say, create your own version of a calculator. Something that can add, subtract, multiply, and divide. This should be dirty, ugly, but works correctly.
After doing this, take a look at some other android calculators on the play store. Check out Simple Loan Calculator. I use this example because it offers a lot of android UI components. ViewPager, ActionBar, etc. Download this app, take a look at it, and try to mimic it. This should provide an idea on how to work with the android UI components.
What's next? After you have done these two apps you should be relatively ready to tackle your own project.
HTML apps are easy to port across multiple mobile platforms. I have set up an Android HTML template as a starting point. You can just import this project into Eclipse and take a look at that.
https://github.com/jakewp11/HTML5_Android_Template
Here is my experience for ios,
There are three things that I consider as pillars
Objective C
Memory managment
Design patterns
The first one looks obvious but I'd stress on learning concepts like protocols, categories, extensions. As a beginner I thought that learning the syntax was enough, but time and again I had to jump back to the language concepts to understand what's going.
The memory managment , the most talked and confusing subject and now since we have automatic referenc counting to make things simpler and often new Dev skips learning memory concepts (I did it). So I suggest you to have an idea what actually happens under the hood of arc " the manual memory managment"
The design patters,
When I started off , to pass data and control , what I used to do was achieve every thing through the only design patten I knew (target action) . I lack the knowledge of design patters didn't how easily I could achive better results with less code.
Some resources:
Dev.apple.com
http://www.raywenderlich.com (one of my best tutorials are here, you can find one on design patterns)
http://rypress.com/tutorials/objective-c/
And yes , the sample projects at Dev.apple are the best tutors.

Android user interface elements usage

I did search the internet to find an answer to my questions but there are no websites that did help me, so I hope someone can! Thank you in advance and have a nice day :-)
So these days I've been busy to get more into the Android Design guidelines and to learn more about it and how to implement it in my future applications. This is the main website I use to see what the guidelines are: http://developer.android.com/design/index.html. Great website but there are a few small things I just can't find in the dev guide or somewhere else. I just don't know how to implement some (simple) UI elements.
Can someone provide me code snippets of the following questions? (I want to know how to do it as simple as possible, how Google ment it!) It can help other (starting) developers too!
My main question is, are there special elements to achieve these things? As they are the key element in Android 4.0 it should have this things as some standard right?
1) Android 4.0 is using titles with dividers a lot in there new theme and it's looking great. But I can't find how to do implement this element simple like it should. What I want to know is how to make this blue title text with the grey looking divider underneath it look at this picture:
2) How to make section dividers in general? Like this image:
3) How to make a list with section dividers and give a list-item a 2-line explanation under it's name like this:
I did search the internet to find an answer to my questions but there are no websites that did help me, so I hope someone can! Thank you in advance and have a nice day :-)
In most cases how you are going to have to do it is create a custom layout. I tried recreating the look of the people application this way. for the most part the look you are going for is similar to the PreferenceActivityview. That gives you the look of the last image and probably how it was done in the People application with some extra programming. I just found it easier to create my own layout though instead of trying to mess around with that.
To my knowledge there is nothing in the api to create what you are looking to do easily and custom layout are going to be the way to go.
the custom dialog layout like you show in the beginning is very simple to do so if you dont know how to do manipulate layouts I would start there. look up the android color swatches to get the color of that blue
Edit
another thing you could do is look through the People source code and see how they did it but it will probably be more of a pain than what its worth when you can just do a layout

Where to find Android Development Homework Problems

Ok so I am starting off with android development and I have found a bunch of useful tutorials so I am set there. What I am looking for is a resource that provides homework style problems to do and has the answers downloadable so I can check my solution against the "official" solution.
So for example instead of the notepad tutorial it would be: "Build an application that you can create, edit, delete notes, ...etc.". Ideally the "official" solution would have some explanation as to why they built it the way they did. (so a tutorial at the tail end)
Anyone know of any resources that provide their tutorials in this format?
Thanks.
Okay, here's one: build me an app that allows the user to make, modify, and store notes. The 'official' answer is the Notepad app in the 9th level of the api. (Note that this is different from the notepad tutorial).
The point is that asking questions is easy, the harder part is actually making a program that does the job. And #Roflecoptr is right, at this level it can be implemented very differently. But if you want that mindset, you can write your own 'homework' easily. Just think up a few things you want that are simple, build it, does it do what you want well? Then you pass.
Despite for very trivial problems I dont think this is possible, because there are way to much possible implementation possibilites so that you can't compare your solution to the "official" solution.
But why do you need something like that? If you want to learn to program on Android, you can just follow some tutorials you've already found and then modify them, adapt them to your needs. When you get more used to the development of Android apps you can just get some ideas on tutorials/android development sites and then implement your own solution. There is plenty of help available here on SO and on other development sites, which will help you if you really get stuck.
You could always go to the Android Samples page, and without looking at their implementations, do your own and compare. The samples page is here:
http://developer.android.com/resources/samples/index.html

Categories

Resources