4

皆さん、こんにちは。お時間をいただきありがとうございます。

問題の紹介:基本的に主な問題は、私が Android タブレット アプリケーションを設計していて、私が考えていた種類の設計を実装するための最良の方法が正確にわからないことです。OpenGLやHTMLなど、Android以外の別のプラットフォームを使用できることを読んでいますが、実際にそれを行う方法と必要かどうかはわかりません。

私は何をしようとしていますか?私のアイデアを言葉で正確に説明する方法がわからなかったので、それについての小さな画像を用意することにしました。

私が実装しようとしていることについての設計

したがって、ボタンをカラースクエアにドラッグアンドドロップし、衝突しているかどうかを検出し、衝突した場合はイベントを開始するという考えです。次に、すべてのボタンが再び順番に並べられます。

質問はどれですか?私はAndroidが初めてで、OpenGLに賭けるか、Androidで直接プログラムする必要がある場合、これを実装するための最良の方法がわかりません。そして、どちらの場合も、このようなものを作成し始める最良の方法はどれですか?

最後に:念のために言っておきますが、これは誰かに頼まれた学校の課題ではありません。私は自分でやっています。私は人々に私の仕事をするように頼んでいるわけではありません私はただあなたの意見を聞き、これを管理する方法について助けと指導を求めているだけです. (ですから、コードの1行ではなく、あなたの専門家の意見が欲しいです):D

皆様、誠にありがとうございました。:)

マルティ。

4

3 に答える 3

2

これは、ドラッグ/ドロップ イベントのサポート ライブラリを使用して、タッチ イベントを使用して HTML / JavaScript で行うのが非常に簡単であるように思えます。それがあなたにとって重要かどうかはわかりませんが、このソリューションの良い点は、Android から他のモバイル デバイスに非常に簡単に移植できることです。

Quintin が言ったように、パフォーマンスが大きな懸念事項である場合は、最適化して OpenGL に移行できますが、おそらく 1 日以内に HTML の単純なプロトタイプをノックアウトできます...

于 2012-10-17T08:00:25.817 に答える
1

私の意見では、フレームワークは必要ありません。すべてアンドロイドでできます。また、Androidを使用することをお勧めします。私は良いデザイナーではありませんが、私の提案は次のとおりです。

2x Framelayout、左側のカラー ツール用、右側の 1 つ カラー ツールの場合、2 色ごとに LinearLayout を使用できます。また、正確な背景デザインが必要な場合は、画像ソフトウェアでデザインし、背景に設定できます。色については、imageButton を使用できます。

また、アプリを設計する方法のチュートリアルを読むことをお勧めします。ここに良いチュートリアルがあります: http://mobile.tutsplus.com/tutorials/android/android-layout/

于 2012-10-17T08:10:24.063 に答える
1

Open GL seems to be your best bet here. I haven't had much experience with Android OpenGL, but it is going to be the most efficient way to write the app - since you are dealing with collision detection and colours.

Android OpenGL will be the best option since it will be natively compiled by the ADK whereas HTML is going to be interpreted at runtime.

As far as using normal bland Android layouts, I would not recommend that, since this is not a "standard" UI using the standard components. You are creating an entirely unique interface that is very graphical, and so I would recommend sticking to that.

EDIT: You will find that by using standard layouts that ALL of your user interface components will have to be customized, and you will spend a lot of time in your onDraw() methods with the collision detection.

One problem with this is that you need to check whether the object collides with another object, making certain types of objects aware of each other, and may run the risk of circular references. Whereas if you use OpenGL, you can have one list of "Shape" types and then have a "checkCollision(Shape draggedObject)" method which iterates through the list of shapes and checks the collision using an optimized collision detection for the simplest object.

The second problem is doing collision detection in the onDraw() method will make your app lag and seem sticky to the user while performing a drag. 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

于 2012-10-17T07:55:45.497 に答える