I've been searching around quite a bit and haven't been able to find any details on how to accomplish what I'm attempting to do. I would like my Java application to "snap/mount/stick" to the top of the screen so that anything opened up after it (for example, power point) would only use the remaining space instead of the entire screen when maximized.
I'm not even sure if it is possible, but if it is could someone point me in the right direction?
Thanks.
You can't do that using standard Java features - only with some native code assistance which should be able to modify other applications behavior, so that they pack themselves into the remaining screen "space". But you will have to code that native part for each OS you want to support. And also you will have to call those native features from Java using JNI. And also some application might act unexpectedly when you will try to modify their size.
Anyway, its a bad idea to do such a "feature" in your Java application - you will have a lot of headache supporting it in future.
Related
I am new in 3D modelling, I am not expecting exact ans but any hint, link or direction will good for me. I am working in java and i have to work with 3D model now. So its like, I will make a model (using XYZ software) and define some parts of it lets say part1, part2. Then at run time on browser user have a drop down to select the part and then he give some value , now i want to change the 3d model according to that value of that part (that could be length,width etc) and user should be able to see that on browser.
First, Is it possible, changing dimension at runtime (I can make some restriction also)?
Second , Any hint , library or logic direction will be great help.
I can go for any language , any software now as because I am about to start from scratch.
If I haven't made my question clear, do let me know.
One solution I can think of is for different possibilities ,I should have different model already in background, and load that one , whose dimensions matches with user selection.
OR any other suggestions ??
Your question is quite unclear in that you say that you are using Java but can go for any language...
I am making the assumption here that you are indeed using Java. There are several libraries available for Java that support "rendering" of 3d objects. The level of abstraction depends on the individual library/framework.
Some example of what are referred to as low-level libraries:
Java 3D, (OpenGL wrappers)lwjgl, JOGL.
Some higher level frameworks:
JMonkeyEngine, Andor3D, Ogre4J.
I only list a few as an exhaustive list is not what SO is for, nor am I going to compare them for the same reason.
If you want to code the loading of assets, how they render, how they are stored at runtime, how they should be rendered then you will probably be going with the lower level ones. Going with a framework means you care less about what low level graphics library you use rather what the framework can offer.
Your second set of questions really deal with details that you would only need to worry about after the initial choice. If you have model loading code then you can just load a new model triggered by an event.
Edit: Only caught that you said run in browser, if that is a requirement then that complicates things. You would probably need to go another route, perhaps WebGL and javascript, or three.js.
Again without a more specific question, can't really give a more concrete answer.
Edit : Reuest per comment:
Although flash support is being phased out of web-browsers there are several libraries available. papervision, unity3d-web, away 3d. I have away3d myself on a small project for a simulation visualisation project. It was pretty easy to use, but for what I needed perfomance was not good, but then again I would not recommend using flash for 3d either. That said it has probably improved since then.
VBoxManage can do this. But I want to do this myself in my program (to write a robot).
UPDATE: I've answered your other question:
What API does VBoxManage.exe use?
It's a fair amount of overhead to bind to that API if all you want is a screen capture. For that operation, it sounds like you have the tool you need in your hand...VBoxManage is already cross-platform and already built. Look into some form of exec for whatever language(s)/platform(s) you're actually using.
However, if you really want to be doing lots of automation and need more functionality (moving the mouse around, drawing on the guest screen)...that's what the API is for. Though if you don't write it in C++ you're probably setting yourself up for a nuisance.
If I were going down that road, I'd probably follow the VirtualBox build instructions and get VBoxManage to build. Then I'd duplicate the VBoxManage build environment to make MyVBoxManage (or whatever), and tweak it a little at a time.
I have a java application that was mainly built for the Mac. I need to be able to do either one of three things:
Have my application always follow the current space. Meaning, if I'm on Desktop 2 and start my app, then I switch to Desktop 3, my app will then be visible on Desktop 3 automatically. This is equivalent to right-clicking on the app icon in the dock, select Options, then choose All Desktops. If I can somehow make this the default behavior for my app, without requiring user action, then that would be great!
Capture the screen of a specific space. I currently use the Robot class to take a screen capture. If there is a way I can specify which space to capture, not just the current space, then that would be great!
Be able to at least detect if leaving the current space.
I'm starting to lean towards neither one of these are possible. But if you can give any help, or possible workarounds, that would be awesome!
I have also played around with the GraphicsEnvironment, GraphicsDevice, GraphicsConfiguration, but no luck. It doesn't return any info about Mac's Virtual Desktops (Spaces).
What is also making things difficult is I'm trying to avoid using platform specific code at all costs! I know I can use JNI to accomplish this, or there may be something in the java-apple extension. But currently, I use a single code branch and build for both Mac & Windows. I'm trying to avoid having two separate builds and binaries for both platforms.
The answer is "no" unless you are writing native code and using JNI. One of the key design features of Java is that it is OS agnostic. What you are asking for is extremely Mac OS X specific. I see nothing in the Apple Java Extensions that helps either.
No, as far as I know, Java doesn't have any special support for Spaces, so you'll need to use platform-specific, native code. However, JNI--with all its ugliness--isn't your only option. You can use JNA instead, which is much more programmer-friendly, and a lot easier to debug.
In your app, you can detect the platform. If it's a platform for which you've written platform-specific code, you can execute that code. If not, you can fall back to a default, pure Java implementation.
I was wondering if it's possible to make an IDE-like application for Android where users can write some Java or C/C++ code and be able to compile it, run it and be given the output in an Android application? (Not desktop!).
If it is possible, what are the limitations? I presume there'd be limits like the user wouldn't be able to make GUI's and execute them, or am I wrong?
Thanks,
Alex.
Yes, it is possible. Those applications are called IDE's. There's no special magic behind those - an IDE is just another program, albeit typically a rather big and complicated one.
That said, why would you want to do that? There are plenty of IDE's out there already. If you want an exercise, maybe something less ambitious would be a better choice.
There's no reason why your IDE should prevent the user from making GUI programs. After all, existing IDE's would let you.
Also, there are IDE's out there that are highly customizable (Eclipse and Visual Studio come to one's mind first), so if you're missing a bit of functionality, sometimes you can write/find an IDE plug-in for that.
If you don't have an IDE and want a free one, Eclipse is free. It supports Java and C++ all right. That would be much freer that creating another from scratch - time costs, too.
EDIT: I see. Now, the limitations are: small screen, lack (typically) of a hardware keyboard, limited memory, limited and slow disk, battery lifetime, overheating... App development is an expensive task.
EDIT2: looks like you're not after general purpose application development on Android, but want your app to be scriptable by end user. If that's indeed the case, C++ and Java are not the best languages to support. Android already comes with an interpreter for a scripting language - the language is JavaScript, and the interpreter is WebView.
As time goes there are more and more possibilities here.
AIDE, the Android Java IDE is quite successful, free environment. You can create Android applications on your Android device. It is in a continuous development by a German team. Now there is syntax highlight, fix imports, code completion, refactoring, compatibility with Eclipse, connection with Dropbox, git pull (and push in the premium version).
You can also find (non-free) C/C++ compiler like this or this. I have no experience with them, the first is really good according to the user responses.
The main limitation can be the screen size and if you have no external keyboard then it gets worse. The performance seems to be OK on a Tegra device - I use a 7-inch Iconia Tab A100 with Tegra2 -, however I think right now it is an auxiliary solution to a desktop/laptop based development. I now that the last sentence soon may become obsoleted.
I am going to create a Text to speech converter, which can be executed in both Windows, and Linux based systems. Can someone please help me answer the following questions;
What language should i use; Java, C++ or any other?
The program i am going to create should be able to read large chunks of data.
There should be good sound quality.
What are the libraries available to achieve this?
Please share your experiences as well.
Use the language you're most comfortable with. I learned the hard way when I tried to re-code my raytracer in C++, coming from a Python background. It took me weeks to get it to function...
Basically, you'll get frustrated by the nuances of a new language before you can get to coding something, so I suggest you stick with what you know.
That's independent of the language. Just makes sure to read the data in chunks (like 2048 kilobytes at a time). Reading a big file to RAM is not a great idea, as you can't be sure your end user has enough RAM (audio files can get BIG).
This is trivial. I can't help you program good sound quality. That's up to you.
There exist a few implementations of TTS for Linux, so that's all I can recommend. Look at Festival, as it is one of the ones you can actually understand.
Long time ago i had that same idea. I think it is not too complicated and can be done. This is how i would do it:
1- I would use Java, because it is platform independent.
2- If you are going to create an standalone application, it will be the local computer that will do the processing an not an application server, as in the case of web apps. Also i suppose that your program, will be used only by one user at a time. I think you will not have big issues with the amount data to process, if u implement some buffering mechanism.
3- The quality of the sound will depend in various factors such as: noise when recording,format, speed of the sound... Notice that many text to speech applications that exist on the web, the sound quality is ok, but you will never get the feeling that it is a real person, who is reading. (I recommend you a female voice, it sounds better).
4- Regarding to the libraries and another gadgets, this is what i think you might need:
-Java Standard Development Kit(To be able to work with java)
-A good IDE: There a many out there you can get for free. My favourite is eclipse but if you are a beginer with java, you might like to start with netbeans many people say it is more intuitive for learning.
-JLayer Mp3 library This will help you play the sounds in java.
-javax.swing Is a java library that is included in the development kit and allows you to create rich graphical user interfaces. Also if you are new to swing, i would recommend you a great swing IDE, called JFormDesigner, have a look at it, im sure it will speed your development alot(It is a great tool).
I hope my answers can give you some tips.
Update
I think it would be correct to mention also, that the only minimum requirement the users of your app will have in order to run the app is:
JRE(Java runtime enviroment)
This project of text to speech can be made using computer generated voice
so no problem of storing a database for each word and its pronunciation.
Just use the language in which u feel master to urself and apply the concept.....
I do not know anything about text to speech except that it's not easy. That being said, I suggest you stick with the language you are most familiar with. I'm sure Java and C can do it.