The Android app I'm working on makes use of Android's baked-in speech-input feature, but I want to alter the look of the speech-input dialog to be more of an aesthetic match with the rest of my program. Is there a way to substitute my own assets? Is it a simple matter of overriding the layout xml that the parent class references? Thanks in advance for your time!
yes you can make a custom dialog and use setContentView(R.layout.something)
I am afraid it is as easy as substituting a layout.
You need to manage your own speech recognition flow by using the SpeechRecognizer class.
There's a lot of details involved in using it, but it appears that you can customize the UI experience if you can.
Related
I want to create below type of custom range picker in flutter
I have tried use below library but i haven't found way to modified them
https://pub.dev/packages/flutter_date_pickers
https://pub.dev/packages/flutter_calendar_carousel
https://pub.dev/packages/calendarro
Is there any way to create these type of range picker in flutter?
Can any body guide me or give any hint how can i achieve these?
If need more information please do let me know. Thanks in advance. Your efforts will be appreciated.
I think you'll have to write it yourself. These packages are not customisable enough to create exactly what you want.
You can off course take a look at their code to see how they've done it.
Maybe even extend some classes to override certain functionality if the package allows that.
I want to add a small type selector, which will give the user three options (good, so-so and bad).
Quickness and simplicity are the main goals.
Something like this would be great:
What type of widget should I use? (I'm using android studio)
I didn't downvote, but the reason might be that you are asking for a iOS-ish pattern, not really present in the android guidelines nor ever promoted by Google.
The common way of achieving what you want in a neat, but framework-accepted way, is using RadioButtons inside a horizontal RadioGroup. I believe there's no need to tell you how, as there are dozens of questions here and it is a pretty straightforward task.
If you really want to stick with that pattern, you could use some external library, like this.
How to create a piece of UI that can be used across multiple activities without duplicating the layout and business logic? Please provide some kind of example. Thank you.
You can reuse layout like this. Also, see this answer.
This is relatively simple and there are a few ways to do it, but essentially you want to create a custom UI component. The Documentation describes it a few approaches here, and there are a few tutorials out there as well as SO questions:
http://www.anotherandroidblog.com/2011/05/26/custom-composite-android-component/
How can I create custom controls in Android?
Android - Writing a custom (compound) component
In addition to the other answers, fragments can fill the role you are seeking.
I am new in android, I dont have that much of experience. I want to know making a custom component. I followed http://developer.android.com/guide/topics/ui/custom-components.html. But many things are not getting cleared. Recently I visited a link http://code.google.com/p/android-wheel/source/browse/trunk/wheel/src/kankan/wheel/widget/WheelView.java?r=4. There they have made custom component.
Please suggest me a well documented tutorial where I will get a clear picture about making custom component where onMeasure(int,int), onDraw(Canvas) all methods will be used and all the things will be documented well, why we are using this?
Please suggest me such a link or tutorial. I really want to be confident in it.
The question is somewhat unclear. What kind of custom components do you want to make. Just regular views? Viewgroups or perhaps custom adapters? You will probably find plenty of good material if you search more precise.
But to start you of with some:
http://www.anddev.org/creating_custom_views_-_the_togglebutton-t310.html
http://www.anddev.org/advanced-tutorials-f21/custom-views-t1891.html
Since I am a new user I can't post more links.
I am very new to Android development and, while I get the general premise (and have even built a small application), I have been looking at other developer's source code to get an idea of how to better approach my development for larger projects.
One developer's code is read is basically using both XML layouts and Views for the various parts to the UI (similar to what is being asked in this question). I understand what he is doing, but it seems overly complicated to me. The XML layouts provide functionality already to create responses to actions. (For example, "onClick" is provided for most components in the XML.) Layouts can be generated very easily with the XML.
So, my question is - can I get away with building my entire application using just Activities and XML layouts? Can I choose not to use any Views? (Of course, this is assuming a relatively simple app - think task list or something similar.) Or, am I trying to simplify too much?
The general strategy I use is to push as much as possible into XML. It's a very different way of thinking from some other UI development systems, but it's very cool once you get past the learning curve.
I don't know what you mean by choosing "not to use any Views". Every UI component is a View of some sort. If you mean not using any custom View subclasses, then yes, it is definitely possible. The only reason to create your own custom View classes (and then use them in XML!) is when the stock widgets and views don't do what you want. Since they are quite flexible, this tends to be fairly uncommon (until you start getting into fancy behavior or need custom graphics behavior).
There are two ways for Creating UI for Android Application. They are
Using XML - You can use xml for designing UI targeted for supporting Multiple device. Also XML helps you to create Static components.
Java Code -Generally it's not a good practice to creating UI in java. Its suitable, if you creating a samll application. Its also useful when you want to develop application with dynamic components. If you want to create Dynamic Components in UI, Java code helps you to achieve this.
The Good Approach is to create UI via XML, unless there's no dynamic component needed in the UI. if you need dynamic UI creation then you go custom UI creation i,e., Using Java Code.
Since you are New to Android, i would like you to refer android developer site
I think you misunderstand, XML layouts are just a shortcut for creating views. You end up with the same results at runtime either way. Mix, match, use one or the other, it's up to you.