On create, im trying to play two videos at one time. I am currently using two videoviews. Firstly, should i create buttons to start the video views or should I use MediaController? Also, I have haerd that two VideoViews will not work. Is this true and if so, is there a way around it.
Thanks,
XcutionX
There is no reason you cannot play two VideoViews at one time. If you want to show more, I recommend looking at TextureViews (If you are targeting Ice Cream Sandwich or above, I'd recommend using TextureViews regardless).
It makes no real difference if you want to handle the play state with buttons or with the MediaController. Do whatever you think looks right.
Related
I'm working on an app where I need to draw a lot of data. There are different functions that can be used to work with the data. The main functions share two views, that right now I draw every time I start the functions. They differ in the middle part where the data is displayed different. Right now my main goal is to improve the performance of the app. When I switch from view A to B runs smoother than the other way around. My idea is to store all the parts (from all views) in a list so when I jump back to the view I can reuse them instead of building them again. Is this a good idea? Are there some general performance advices when building an app with javafx?
In GUI desktop development, there is a technique named "double buffering", which is useful to make fast screen flips:
It consists on having two separated and different panels that occupy the whole application viewport and that must be permanently updated, but just one of them must be visible at the same time. Changing from one to another is as fast as to hide one of them and to show the other one.
I swear, this control has been the bane of my existance this week. Just FYI, I have pretty basic OO/Java skills, I've mainly been using xml to create layouts, but I need to use the gallery control. I've finally got the sample code working from the sdk, but one thing remains a mystery despite looking here, googling elsewhere, etc., there seems to be no clear answer on how you exactly manipulate the attributes of individual images within the gallery. I keep looking for an example of a template that I could implement, but see nothing. Really, I'm not looking for anything fancy, I just want the images to scale properly within a fixed height gallery control, and surround each image with a 1dip light border, and keep each of them about 4dip apart from one another, that's about it. But for the life of me I'm just not seeing how to make these customizations, and I'm starting to tear my hair out! :-/ Any help or reference to how to do this with some actual examples would be priceless!
Yeah, just to continue on your own answer.
The getView() method of the adapter is the place where you'll do anything you want with the images, i.e. set up borders, layout params, lazy loading, etc.
As long as the method returns the View you've made changes to, it should work just fine.
I am developing desktop GUI application using java swing. And I want to show several "subwindow" on the same window(JFrame). And I want the layout is similar to iGoogle such that user can add and remove new subwindow. To be simple, I assume all the "subwindows" have the same size and similar content(all are showing chart). By the way, the maximum number of "subwindow" would not be a huge number. I think it is less than 8.
if there is no drag and drop, can I just use grid layout to
implement it?
if there is drag and drop, what is the easy way to
do it?
Thank You very much.
FYI: iGoogle http://www.google.com.hk/ig
I don't know what iGoogle is, but it sounds like you should be using internal frames. See the section from the Swing tutorial on How to Use Internal Frames.
If all the "sub windows" will be equal size and not draggable, I'd just use a simple layout. seems like a good case to use TableLayout. In a simple case where you know the max amount of slots, you could have 8 corresponding JPanels and add them to Container using the table layout (making sure to revalidate()) as the user requests them. if a user closes one, you just remove it from the container and revalidate. Hope that helps. if you don't need docking functionality, don't even go down that road is my advice.
EDIT:
you could also still implement drag and drop by using your own mouse handlers.
In swing(GUI) application I used JButtons.
Now I need the same application in MIDP and I'm conuse...
I need Idea for what to use with and an example of how to use it and what kind of listener might possible fits.(Because I need to refresh the shown screen after every click on a button)
And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny,
so is there any way to make this screen larger,In case I need to show something too width?
Lets say,something like 11-15 buttons...
I don't think there's anything that's exactly equivalent to a JButton, but I think you could solve your problem by implementing a Command though. I found a lot of examples:
MIDP Programming with J2ME (This one is a bit long. It's actually an entire chapter from a book and the Command example starts on page 4.)
Enterprise J2ME: developing mobile Java applications (Also a book, but I linked to the relevant section.)
J2ME Programming (Part I) (I like the CommandProcessor.java code example in this one.)
Visual Mobile Designer Custom Components: Creating Login Screens
Add Command to MIDlet (This one has the shortest and clearest example code, but it unfortunately doesn't have a screen shot of the final result.)
And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny, so is there any way to make this screen larger,In case I need to show something too width? Lets say,something like 11-15 buttons...
There is a way to choose an emulator with larger size screen. Last time I checked, Netbeans documentation had instructions on how to do that.
Though, before doing so, I would recommend you to find out whether the real device you're targeting will have such a screen. Because if its screen will be as tiny as the default emulator then your UI might look totally different from what you designed with large size emulator.
Take for example 11-15 buttons you mention - do you expect real device to have screen large enough to display these conveniently for user?
i wonder how you can make an advanced Android User interface where you can add for example a drag drop and more graphics options? is that by using OpenGl ?!
this is example of UI in iPhone Apps.
example 1
example 2
Thanks
Your examples just seem to be composed of a lot of nice images. Your first example looks pretty static and could probably be made from buttons with custom images and setting lots of backgrounds on your layout items. The second looks like you would need to make a custom Gallery and do a little more manipulation and composition of images so it might be worth your time to go a little lower level for performance.
Basically, you're looking at using a lot of images. You can make them work with existing widgets and components and get the functionality more easily, or you can use OpenGL ect. To get some more flexibility and performance at the cost of having to code all the functionality in yourself.
If you're looking at drag and drop this post points to the source for a ListView with some rudimentary drag and drop functionality.