[Q] Best Practices for Switching Between Fragments? - Android Q&A, Help & Troubleshooting

I'm wondering if I am doing Fragment navigation incorrectly. For the most part, my app is a series of full-screen fragments, and to get to the next one, I create a FragmentTransaction and then replace().
The problem is, occasionally, if I spam the screen with touch input, Fragments behind the current one will have onClick() called.
Is there something I need to do when replacing that I might have overlooked? How could views behind the Fragment I am looking at be recieving clicks?
What are the best practices for fragment switching/navigation?
(P.S. is this the best forum for this time op question?)

Related

[Q] How to get a reference to the stock launcher activity object?

I want to read out the shortcuts' and widgets' position and name on the screens of the launcher. Since every launcher is different, I will focus on the stock launcher of Android for the moment. I have not found an API to do this, so I am trying my luck with Java's Reflection API. So far I have been able to get the class and read out the type of the variable holding the items on the desktop called mDesktopItems. But to read out the variable's content, I need a reference to the launcher activity object. It's obvious that this object does not have to exist, but I can probably check regularly and once it does, I would fetch the data.
So how do I get a reference to the launcher activity object? Or could you think of a better way of fetching the required data?

[Q] Infinity screen = Graphics / Game Engine ?

Friend of the night, goodnight !
I am trying to develop an Android application.
But I'm at the crossroads of a crucial choice for developing my application, let me explain:
For my application, I need to provide a "infinity" screen , The screen should be endless defined (Height and width not defined) to let the user navigate / zoom as he wants . In addition, some elements should be addable on the screen (Geometrical shapes or other stuff).
For example, the user presses the "bubble" button on the screen , a bubble appears under the finger of the user then he drags it on the screen until the place he want .Once he releases the finger, the "bubble" is grafted to the "infinite" screen .
Generate this kind of thing in my opinion is more useful if you use a graphics engine like AndEngine or other. But is it the best way? And how to save the state and elements on that screens? Using the same systems then MineCraft which generate the world as the user go
Which I had never explored this part of android, I ask your opinion on this delicate points ....:good:
One more thing , This application should enable to run on any average phone (like my HTC Desire)..
Hope I hope I am clear enough ,
Thanks

[Q] Budding developer with a fleshed-out idea for a musical Android app

Hi everyone, I'm a longtime lurker on this forum, but this is the first second thread I've opened. I've just begun studying at the university level, majoring in mechatronics systems engineering and minoring in computing science. I've done a lot of research in the area of music theory, and I discovered peculiar arrangement of musical notes which I call a "pitch-correct harmonic note table" (Google it for a higher resolution than the attached image; I'm too new to post links).
The concept has been explored in the past (see Wikipedia's harmonic note table layout) and the interesting thing about it is that it visually reveals how notes and chords are related to each other. My version, unlike every other one I've found, preserves the proper pitch spelling. A C minor chord, for example, is properly notated as C-Eb-G, not C-D#-G.
The table by itself can prove useful for those learning theory and composition, but right now it's just a picture. Here's where Android application development comes in. I hope to turn this picture into an interactive chord-generating device. It'd be like a guitar, except anyone can pick it up and create music with it, as the chords are easy to play and the relationships are obvious.
The application's general flow would go something like this: First, select a key signature (which positions the purple ribbon), time signature and tempo. Hold down the root of the desired chord. Slide your finger up to select its major chord or down to select its minor chord, and release. Press the root again to play the chord or press a different note (like the seventh) to play an extended chord. The chord will loop until you perform that last step again for a different chord (selecting another chord by touching and sliding does not interrupt the looping).
However, here's where my inexperience with development hinders my progress with this application. I've only taken one programming course and it was in C. I'm taking the Java course now but we're only going as far as the command line. I'm therefore at a loss as to where to begin. I have the SDK and Eclipse all set up and I have some basic ideas for how I would go about coding the notes, like using the "fifths" and "augmented" axes to create a rectangular grid instead of trying to use the hexagonal grid that the table is currently in. I'm probably going to end up creating a playChord() method with parameters for root, quality, extension, and bass. I'm not sure whether to use Canvas or OpenGL; I'm not sure whether to use JetPlayer or MediaPlayer, .mid's or .mp3's or .ogg's, or generate the chords on the fly; I'm not even sure how I'm going to voice the chords (though my Casio keyboard might be able to help with that).
Most of those issues I can worry about later though. For now I'm going to focus on creating something like a soundboard except more refined. This is why I looked to XDA - to give me an initial push in the right direction so I can avoid coding myself into a corner and having to start over. If you can give me any tips or advice, I'll greatly appreciate it. =)
Bump? =)

Some Android app designing help for a noobie

Hey guys, I will try to be concise.
I decided to do an Android app for my final degree project. I followed all the bucky's videos and I have been playing for a couple of weeks with some additional material (text to speech, external databases, creating my own server, php...). So I think I've got the basics.
Okay, here's the problem. I decided to make an app which, basically, includes 3 types of "exams". I will follow the users progression thanks to a learning algorithm and I will purpose different kind of activities according to his/her weak points. The exercises idea is pretty basic (because I want to make it really easy for anyone to afterwards add their own exercises). It will be an image with four options, and just one of them can be selected as the correct one. Each exam will be composed of 20 exercises, and each "individual screen" will have the following elements:
- The image (different for each question)
- The possible solutions (different for each question)
- A dropdown menu (The same for all questions)
- 2 arrows for going to the next and previous exercise (the same for all questions, except for the first and the last)
- Two rows, with 10 cells(squares) per row, as a navigating tool for the user ( so if the user clicks on the third cell, the third exercise of the exam will be displayed. I will probably change the colour of the cell if the user has already selected an option or not) (The same for all questions, except for the color probably)
The squeleton of the APP is more or less done. Users can register, login, my DB is working perfectly, the "selection screen" is done, with different ways of receiving help (text and audio). In other words, the next step is necessarily making the exercised themselves. I have enough time, but I really want to know which is the best way to proceed. I don't mind failing a couple of times (as long as I learn), but I would love to know your opinions.
Each exercise is a different fragment? I mean, all of them have the same structure, is there anyway to create a kind of "base" class for an exercise, as only the image and the options do change from one exercise to the other? The menu, the arrows and the navigation bar are the same.
Any opinions and ideas are totally welcome.
PS: Sorry for my terrible english, is not my mother language.

How to have a Smooth integer increment while touching screen

Hi all,
After googles and forum looking it is time to ask you
I am a new Android developer, but I am a java and C++ developer, so my problems are just sdk and Android experience.
I am trying to develop an app that have a square area of 200dp in the screen center, and when we touch it with a movement an integer is incremented (or decremented) like a smooth scrollbar (one int for Vertical and one int for Horizontal)
I tried with NestedScrollView and with SurfaceView to get scroll position, but it did not the job.
Have you some idea about to way to do it?
Thanks a lot by advance
Hi,
anyone have an idea about this problem?
Thanks by advance

Categories

Resources