Fast way to create a view [closed] - android

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
This question has been bugging me for a while now.
The idea is that I want to use a way to draw/create a view in a fast way.
I read that XML layout has more advantages than a dynamic one.
I read also about caching. Apparently, we cannot/shouldn't cache the whole UI element. If we save its state/value and re-create it, doesn't it take the same time as creating it from scratch? Is there a significant way to draw a view in a faster way?
What's my goal?
Say if I have different activities in an android app; the second time I visit an activity, I want it to "render" faster to optimize the performance and usability. Is there a way, like caching for example, or any other way? Or am I stuck with re-creating each activity from scratch from XML Layout or programmatically?
Thanks in advance for any thoughts..

the second time I visit an activity, I want it to "render" faster to optimize the performance and usability
Well, it will do that to an extent on its own, as your resources will already be loaded into the process.
You can also bring an existing instance of the activity to the foreground, creating a fresh one if there is no currently-running instance, via things like FLAG_ACTIVITY_REORDER_TO_FRONT. However, that's more of a way of controlling navigation, more so than specifically addressing performance.
You are also welcome to minimize your number of activities, going with more of a "fat activity" architecture, heavily leveraging fragments, where you can do a bit more caching of actual views.
If you have existing code that is exhibiting performance issues, use tools like Traceview to figure out where your time is being spent, rather than just guessing.

Related

where do i start with an app that's going to hold a database on ios/android? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
i want to contribute to a fandom i'm in and also practice my coding, so i wanted to make an app that would let the user keep track of the event stories they've read. but i don't know where to start with this.
i can add extra features like scoring and total stories read later on, but for now i need an idea of where to start. i think i've heard java would work for this? but would that even work on android and ios both??
once i know what programming language to use i need to find something to code this on, as well as how to even hold information in a database. (similar to myanimelist and how it has a database of entries that you can add to your own list.) likely with a login system--but one step at a time.
what are the basics i need to know to start? and where would i build this app? thank you!
If you want a single application that can work on both ios and android then go for Flutter or React Native. For your question regarding where to keep database and how login system works you will need to study at-least one of the systems in some depth.

Which is best way to design UI for android (Coding or Drag & Drop)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm learning Android development in Android Studio. My question is that what is the best way to make UI for Android apps. I'm right now learning coding to make the UI of apps. It's a hard or time-consuming process but I find that this is another way to create UI of Android apps via the drag or drop feature. So, I want to ask which one should I choose to create UI of apps ?? because I want to work as an Android Develper.
Thanks yo
Drag and drop are useful when you don't have to make a good/presentable UI, You are just in hurry to check/test something. But for long term or to make reliable UI, I'd suggest you go with writing code in XML. This helps you understand the concept of how things stick to each other and you can make changes easily when needed. All the best.
Try Constraint Layout ,It's very flexible and will help you understand the concept of constraints.
If you want to become an Android developer, you have to practice a lot, the drag and drop feature on the xml layout design is very useful, but it would be nice if you also have to master the attributes and components in the Android layout. It depends on usage, but I would rather write the xml code directly to better understand the points of layout on Android. Keep learning and keep up spirit

Android Studio UI use design or text? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Kind of new to programming, especially with apps
In Android Studio, which is the 'proper' way of designing the UI? The drag-and-drop or manually through code? (Design or Text)
Also, is AndroidStudio the best way to code for apps?
Sorry if its a silly question, new to this stufff
Drag and drop may make a lot of sense when combined with appropriate coding in xml. As #Rai said, it is important to learn how things work via code in xml - but I would like to add that learning things in xml will make the transition to editing views programmatically (dynamically in your java classes), much easier.
Sometimes, however, such as when you are using a constraint layout (a more advanced but very useful layout to use that improves performance in many cases), it is a lot more efficient to get the look you want in the design tab. Check out this tutorial: https://developer.android.com/training/constraint-layout/index.html
In general you should make sure you UNDERSTAND what you are doing when you are making android apps (and coding in general), because if you are just messing around in a design editor you may end up doing things that slow down your user experience and can be done more efficiently. As long as you understand what you are doing (and it is legal) doing whatever is efficient for you as a developer and for your user experience is what is 'proper' - it is an engineering disciple after all.
You should use android studio 2.3x when you are starting out. It used to be true that eclipse was used, but now Google wants you to transition to android studio.
You should not rely on drag-and-drop. Its better you know manually
what a code does before you use drag-and-drop functionality. For
me in android drag-and-drop is not that usable. You should learn all
the attribute, properties and know the relationship between views by writing it manually rather than
using 'drag-and-drop' and ask yourself at the end how UI works and
rendered.

Create Android Game UI [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I Developed An android game Using OpenGlEs
Now I want to Create its UI And Main Menu Items, Im currently using relative Layouts to create the menu, Buttons and their Animation, But since i have many items in my menu, it is trouble to work with,
What is the best way to implement GUI in android? should i keep Going with layouts or work with Canvas and SurfaceView?
It depends on your choice if you just want to choose between XML based and custom Views.
XML based layouts easy to design, so you can quickly implement those, You can have basic animations with them but no complete control over the drawing mechanism. Straight forward control to Inputs.
While Canvas and SurfaceView approach requires you to do all the drawings and then handle Inputs, this way you can have full control over drawings but it adds more complexity to code side.
You can choose what suits your need , on the other hand, if you have too many views ie too many button etc. You can simply try switch statement and applying distinct width/height to each element or use onTouchListener to get coordinates of touch and respond (supposing you already know coordinatesbof all views) hope this helps.
If you're looking for an easy way to create UIs for Android, Eclipse and Android Studio both provide a WYSIWYG UI creator. I have not used it yet but it should be fine for layouts which do not need significant customization. If all you're doing is creating simple menus/text/buttons then this should serve you fine, no need to use anything more complex than the Views/Layouts provided by the Android API.

Library for a simple graphics application - Android [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am creating a simple graphics application, where the user can draw several shapes, change the shape color-size, zoom, rotate the device etc. After researching, I found out that there are many options on how this can be achieved and I find it hard to choose which approach would benefit me more. One approach that I have started testing is to create a custom view and to draw on Canvas.
Is this option valuable in order to proceed without having the futuristic fear of low performance resulting to switch over something else (e.g. something like OpenGL)?
Or better, given the brief description above, what would you recommend as the best option?
As this is an opinion based type of question, I think this one might get closed, so I'll type fast: I think to get your app up and running fast, Canvas is your best approach (lots of easy docs and examples out there), unless you're already an export in OpenGL, to which there is quite a steep learning curve. It doesn't sound like, from your app requirements, you would hit upon any serious performance issues, and, as I say, you can get thing running quickly. If performance is not adequate, you can latter switch to pure OpenGL or use a framework for it like libGDX, Rajawali, AndEngine, etc.

Categories

Resources