What is the best way to implement this graphic design? (Android)

We welcome everyone and thank you for your time.

Introduction to the problem: Basically, the main problem is that I am developing an application for an Android tablet, and I do not know exactly which one is the best to implement in design I was thinking about. I read that you can use other platforms other than Android, such as OpenGL or HTML, but I really do not know how to do this and if necessary.

What am I trying to do? I did not know how to explain exactly what my idea of ​​using words was, so I decided to prepare a small image about it, here it is:

Design about what I attempt to implement

So, the idea is to drag the buttons onto the square of the color and detect if they collide, if that happens, fire the event. Then all buttons will be ordered again by themselves.

What is the question then? I am new to android and I have no idea that this is the best way to start implementing this if I rely on OpenGL or a program directly in android. And in both cases, what is the best way START TO CREATE something like this?

Last things: I want to clarify something just in case: This is NOT some kind of school work that someone asked me to do, I do it myself. I DO NOT ASK PEOPLE TO DO MY WORK . I just ask for your opinion and ask for help and guidance on how to get started managing this. (so I want your professional opinion, not just one line of code): D

Thank you all.:)

Martí.

+4
source share
3 answers

It seems like this would be pretty easy to do in HTML / JavaScript using touch events, possibly using a support library for drag and drop events. I don’t know if this matters to you, but the nice thing about this solution is that it is easily portable from Android to other mobile devices.

As Quintin said, if performance is very important, you can optimize and switch to OpenGL, but you can probably get a simple prototype in HTML in a day ...

+2
source

Open GL seems to be the best choice here. I did not have much experience with Android OpenGL, but this will be the most efficient way to write an application - since you are dealing with collision detection and colors.

Android OpenGL would be a better option since it will be compiled by the ADK initially, while HTML will be interpreted at runtime.

Regarding the use of regular Android soft layouts, I would not recommend this, as this is not a “standard” user interface using standard components. You are creating a completely unique interface that is very graphical, and therefore I would recommend sticking with this.

EDIT:. You will find that with standard layouts that need to be customized for all components of your user interface, you will spend a lot of time on your onDraw () methods when encountering detection.

One of the problems is that you need to check if an object collides with another object, informing about certain types of objects about each other and can put cyclic links at risk. If you use OpenGL, you can have one list of “Shape” types, and then there is a “checkCollision (Shape draggedObject)” method that iterates over the list of shapes and checks for collisions using optimized collision detection for a simple object.

The second problem is that collision detection in the onDraw () method will make your application lag and it seems sticky to the user when dragging and dropping. The more components, the more problems.

EDIT 2: Here are some resources for Android OpenGL: http://developer.android.com/guide/topics/graphics/opengl.html
http://www.learnopengles.com/android-lesson-one-getting-started/
2D example with OpenGL

+1
source

In my opinion, you do not need any framework. You can do it all with Android. I would also advise you to use Android. I am not a good designer, but my suggestion would be for this:

2x Framelayout, for color tools on the left side and one for rights. For color tools for every two colors you can use LinearLayout. And if you need the exact backgraund design, you can create it using image software and install it in the background. for colors you can use the imageButton button.

And I also advise you to read application development tutorials, here is a good tutorial: http://mobile.tutsplus.com/tutorials/android/android-layout/

+1
source

Source: https://habr.com/ru/post/1440232/


All Articles