Alright.. I guess to start this off I am looking to sometime in the near future start building a web based or browser based application that I want to build a part of the interface to be a gps module. this will be for a self hosted application likely on tablets or laptops where it will use the data for tracking information amongst other things. Any way most of the application is being handled in PHP, mySQL, jQuery. So with that my question is, is there any way to build a gps application with that as the core languages used. If it is possible, whats the best gps unit I can use? remember im not nessisarily looking for a fancy gps unit to do this with.. just a transmitter/reciever is fine so long as I can build software of my own around it, also is it actually possible to do this with something like php/jquery? or is this something I would have to go the route of maybe java to handle the hardware transactions of which I can tie php/jquery into that..
I have used a bluetooth GSP receiver before..(HOLUX m1200)
When connected, it sets up a serial connection (COM port). You can't communicate with serial ports using only javascript (or jQuery). The easiest way is using a java applet.
You can hide the applet on your page an communicate with the applet using javascript (jQuery). You can find an example here.
Alternatives are using Flash or WPF with XBAP.
The GPS unit outputs series of location messages etc.. More info about that you can find in the GPS protocol (google it) or here
Hope this helps :)
Some tables and laptops have GPS devices integrated. You should consider whether you are targetting iOS (iPad) or other systems.
For iDevices you can use the native stuff, which I won't bother explaining here.
For Linux or BSD systems I suggest gpsd, which is a service you install which abstracts the details of different GPS devices for you and gives you a sort of web service to query for location data. This would be easy to access from PHP or jQuery obviously.
For Windows 7, check out the new Sensor API.
For other systems, you may need to communicate directly with the GPS devices using the standard NMEA protocol (this is what gpsd does under the hood). This will be substantially more work and probably would mean writing a Java program or similar (basically to do what gpsd does).
Related
I am trying to develop a java app that will run on a Raspberry PI. Raspberry PI will be mounted on a vehicle and I will know my position through a gps device. To solve this, I’ve been thinking on a solution like this:
Use a Webview on my JavaFX app and use your javascript API to build a real-time turn by turn navigation app. However, I’ve seen that your web API is not as complet as mobile platforms APIs. My question is: Is what I am trying to do feasible using your APIs? If so, could you please give me a brief description how to do it?
Thanks!
The Javascript API is not a turn by turn API - that is currently something a bit too heavy for javascript to handle (it could be feasible but it's not commercially attractive right now).
In theory you could integrate directly with the C++ code of the SDK as that should be able to run on Linux (depends here on the gcc version used and the OpenGl support offered - send an email to dev#telenav.com with your scenario and they will advise you).
Or if you can run Android on the device then you can use directly the Android SDK.
I am talking about components that can be externally attached to a computer system via some port or other means, not about any of the component that is part of or peripheral of computer itself.
Actually, working on a college project for controlling traffic lights and boom barrier at railway crossing. I've got knowledge in Java but I do not know how can I get the traffic lights and boom barrier working on events in a Swing based application?
One thing is I can create a electronic circuit which can read the small output voltages at computer ports such as a USB port and used them as a trigger for controlling the devices. But how can I generate that small voltages using Java application?
Is JavaPOS can be the solution? or something else?
Any ideas? Suggestions? Articles? Samples?
I'd work backwards from the external device. Answer this 1st: What's the easiest way to communicate with it? If you say USB, ok, use usb. Then ask, what's the easiest way to interface with USB. Then build in whatever language you find to be easiest this USB interface. Finally, call from your Java swing application to this USB-wrapping application... it could be that simple invoke the app using something like ProcessBuilder.
In other words, I think it might be a mistake to solve the problem of interfacing to something like this device with Java, unless it's easy to do so directly.
Have you considered communicating with these external devices by sending digital signals to a serial port using Java? It's then a simple matter of either using those digital signals directly, or using an Analog-to-digital converter to get a voltage of desirable magnitude.
Same for input from the serial port. The RXTX library can help you do this (communicate with the serial port).
On the other hand, if you have access to MATLAB, then this sort of stuff is a piece of cake. Take a look at the Data Acquisition Toolbox and Instrument Control Toolbox.
I think your looking at this the wrong way. Most lights are them selves computer controlled. The lights are running on a computer system. If your project is to write this start to end, then you need to write a loaded to the light controller that does many things, one controls light color and direction, also allow connections via an out side computer. This connection could be USB, Ethernet ext. Now write a program facilitating connecting to the lights and pass commands to the light controller.
I'm looking for a no-brain application that allows me to send a pre-defined list of commands through a bluetooth connection, or an equivalent Java/Scala library that works decently in OSX (64bits).
In short, I want to use my computer to "simulate" a bluetooth accessory, so I must be able to control the pairing, the exchanged code, and so on...
Thoughts?
Simulating jsr-82 can be done with the BlueCove Emulator Module:
http://bluecove.org/bluecove-emu/
http://bluecove.org/ works on OS/X and am sure there wouldn't be any issues with a 64bit OS.
I'd refer you to this Answer: https://askubuntu.com/questions/20195/bluetooth-emulator
You may want to reconsider your question...
To emulate a bluetooth device you would need to develop a bluetooth driver getting it's input from a different source, this would be far more complex than buying a real device.
If you are looking to get some NMEA data though, you may be interested in this:
Most bluetooth enabled phones have apps that do that:
Android: https://market.android.com/details?id=com.cajax.gps2bt2
Any J2ME: http://www.digitalmobilemap.com/bluetooth-gps-simulator-for-j2me-phone
Haven't found one for iPhone, only reference it can be done: http://spench.net/drupal/software/iphone-gps
Hope that helps!
Can you be more exact?
Simulate a Bluetooth accessory for ..?
There are different BT accessories for different smartphones...
Making a BT accessory for iPhone usually requires an authentication chip from Apple...I don't know if a Mac can do it, probably it could - however I'm pretty sure it couldn't describe itself as an accessory.
Accessories usually imply a piece of hardware, in my understanding at least.
I have been asked to find out if its possible to modify the default screen on a mobile phone with jme. Basically the screen that the phone shows when its on but doing nothing but which usually shows the network and nearest tower info.
My understanding of JME is that this is not possible. One would have to use symbian for this or some older protocol like USSD?
thanks
It is not possible to modify the default screen of a device with J2ME. You need a native application (Symbian, Windows Mobile) to do so. J2ME lays in a sandboxed environment and has many restrictions on what you can access. An application can only be started by the user and can't run as a service. It is also not possible to register an application to run at the start-up of the phone.
It has been discussed that MIDP 3.0 may address many of the above issues, but I don't think it will ever be available.
From an application lifecycle point of view, there are ways to approximate what you are trying to do but they almost unvariably require handset manufacturer support.
If you have a choice, the Sony Ericsson JP8 platform has non-standard extensions to JavaME that can help.
Accessing telephony information, however will be a major issue. Look for a handset that implements the cbs protocol of JSR-120, it could prove useful.
Accessing the phone idle/standby/main screen on Series60 (Symbian) phones will require nokia support too, BTW.
is it possible to create java application that will
work as background process on symbian smartphones?
You can approximate it but J2ME (the version of java on mobile phones) may not be the right technology to do this.
starting a MIDlet (a Java application for mobile phones) when the phone is switched on is tricky at best without coding a small Symbian OS C++ module that will start it for you. If you want to try anyway, look at the PushRegistry class in the MIDP specs
(http://java.sun.com/javame/reference/apis/jsr118/). The Content Handling API might provide some way to do it too (http://java.sun.com/javame/reference/apis/jsr211). When you are ready to give up, do it in C++.
Backgrounding a MIDlet isn't hard. The phone's "menu" key will do it for you. Programatically, Canvas.setCurrent(null) has a good chance of working. Trying to trick the phone by providing a fully transparent GUI and not handling any keypad activity will absolutely not work. Creating and starting a separate Thread in the MIDlet should allow you to keep something running even after your overload of MIDlet.pauseApp() has been called by the application management system.
The real issue is that the MIDlet will not have any Inter Process Communication system unless you make one. The usual way of doing that is a loopback socket connection over which you transfer data. Not a nice or efficient way of simulating IPC. Sharing a RMS record can only be done from within the same MIDlet suite (you can package several MIDlets into the same .jar file), I think. The code to create a provider/consumer data flow over a file connection is even uglier and will raise security issues.
Without any more information about what you want to use it for, my answer is : maybe but you should probably not try.
You will have in-built MIDP support for background MIDlets in MIDP 3.0 (http://jcp.org/en/jsr/detail?id=271). Don't hold your breath for devices to appear, however - might be some time.
(Note that a few Symbian OS devices have more than just MIDP - the S-E p990 for instance, https://developer.sonyericsson.com/site/global/products/phonegallery/p990/p_p990.jsp).
As already pointed out, it might be helpful to have more information on what product functionality you are trying to implement - often more than one way to skin a cat.