java application to emulate Bluetooth mouse - java-me

I want to make a java application to emulate Bluetooth mouse(HID)
the application should run as is in any java enabled touchscreen phone equipped with a acclerometer
I have been looking around and I didnt come across existing product like it. So I was wondering if it is even possible.
Also I am comfortable with Java Standard edition but this I dont have any experience in Java ME so I seek advice on how to proceed .

Related

Can I create a custom android OS?

I currently have an old Galaxy Trend Lite GT S7390 that is so old it's virtually unusable. I want to give it the funtionality of an old mp3 player, but since it has wifi functionality, I thought it would be cool to have an OS that would allow it to work with the Spotify app, however that's ALL I want it to do. I just want it to work with Spotify.
Is this possible? I'm perfectly fine figuring out how to do it, I just need to know if it's technically possible and a direction to begin at.
I haven't tried much yet.
Android is open source. You can modify it how ever you want. You can flash it to any device (support withstanding). But will it support your all your device's specific cheap Chinese hardware? Likely not. You'll probably have to write modules to integrate your specific hardware drivers. That' why most Android phone makers give their own version of Android. However, they have to pay licensing to Google because they are charging you for it. As long as you don't charge for your resulting product, you do not have pay licensing.
Android is written in Java. Here's a link to the project:
https://source.android.com/
I hope your computer can handle running Android Studio. It's a hungry, hungry resource monster.

Is it possible to command the Nintendo switch's joy cons with a PC?

I want to create a TAS that can play the Nintendo Switch games that are only compatible with the joy cons.
There are turbo pro controllers in the market but there is no turbo joy cons, so my next idea is one of two:
To use the Bluetooth to connect a devise that I could control with my PC and can be connected to the Nintendo switch via Bluetooth (or USB) and trick it into thinking that it is a joy con and not a pro controller.
Use the idea above but the devise is the joy con itself, in this case, I would have to connect the joy cont to the PC and command it while it is still paired with the Nintendo Switch
Is there any way to achieve what i'm looking for? Thanks in advise.
Also, if there is a better branch in stack-overflow to post this question I will move it.
Looks like it's already been done, and you'll need a product called vJoy.
https://www.pcgamesn.com/nintendo/nintendo-switch-joy-con-pc-guide
Looks like you'd need to reverse engineer the communication protocol used by those controllers and then emulate that protocol with software. Here is a resource I have found regarding RE bluetooth. Another one I have found here. Redfang may help you in that endeavor, it is software that helps you find bluetooth addresses of devices that you you can't discover normally.
Another idea I would have is to open your controller and solder on some wires to a micro controller, such as an Arduino, Raspberry or something similar to the buttons and analogue controllers and 'input' the commands that way.
Unfortunately I can not offer you any more advice. I hope this helps in some way.
One possible way is to use JoyCon Droid app in Android to controll the Nintendo Switch. If this app can work, it should be possible to make one as PC software too.
Luckily, there are a few easy ways to control Android from PC such as using AirDroid which allows you to touch the Android screen from PC. You can refer to How to remote control Android device from a computer with AirDroid?. It can both mirror the screen and give you the touchscreen control, which you can utilize it to control the JoyCon Droid app.
I've just found another way which is to use a microcontroller as a USB controller here.

How do I change a Java ME device System time?

I'm developing an application that needs to synchronize the time on a server with the time on the device.
Blackberry devices have the net.rim.device.api.system.Device.setDateTime(long dateTimeMillis) method for this. I'm looking for something similar in Java ME devices.
I can live with manufacturer specific APIs - specialy nokia, sony ericsson and motorola ones, and most JSRs.
Does anyone know if there is any way to do this?
Most manufacturers, such as Nokia, don't have that functionality in Java. You may need to take a look into Symbian C++ and other platform specific development tools.
You can't do with Java-me for some security reasons. So you can't change the internal time of system. You can possible to get the current time only.

how to turn Bluetooth on/off with J2ME?

I want to write a program in J2ME to turn the Bluetooth on/off automaticly in a certain time without the user permission.
I'v been looking for a while but I couldn't find an answer.
Some phones will automatically switch bluetooth ON when a MIDlet starts using the Java ME Bluetooth API.
Other phones will not.
AFAIK, there is no Java ME API to switch bluetooth ON/OFF.
I have yet to find a mobile phone that automatically switches bluetooth OFF after some time of inactivity.
Any way you find to do this (I'm sure it's doable in Symbian OS C++, for example) will be platform-dependant.
There is definitely no way to programmatically switch your Bluetooth on and off in Java ME. However what may be useful is to switch between discoverable modes:
LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC);
to be discoverable, and
LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.NOT_DISCOVERABLE);
to hide from other devices. It doesn't save battery, but it does make things that little bit more secure I guess.
No way. We cannot be able to automatically turn on/off bluetooth in java & j2me. Better you refer to the documentation of JSR 82

How to run the embedded application

For example, I just developed an embedded SWT application which require CDC/FP1.0 j2se1.3 (I use the eclipse IDE), but how to test this application to see if it is can really run on embedded environment?
Thanks
Not many phones with a proper CDC stack have actually been produced as far as I know.
There was a port of the reference implementation of at least one CDC profile to UIQ 3.x that can be installed on a Sony-Ericsson P990 (and maybe Sony-Ericsson M600, W960 and Motorola Z8) phone.
Presumably, the Sun Java Toolkit for CDC contains an emulator that can run your application.
If none of that works, I would advise searching for what the companies on the two JSRs (JSR 36: Connected Device Configuration and JSR 46: Foundation Profile) expert groups did with CDC and FP.

Resources