SE401:Group32:June 18

From Marks Wiki
Revision as of 05:21, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (20 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

◄ Main Page

Sakura's Research

J2ME communication examples (not bluetooth)

Bluetooth server client connectivity example => This seems promising. We should try it out ASAP

This is how I've figured how the whole thing should work (considering the phone is the server and the computer is the client):

  1. On the computer open Bluetooth connection and send Testing.java class.
  2. Phone receives java class.
  3. Computer sends an instruction signalling the phone to start the Testing.java application.
  4. This application is then run.
  5. Bluetooth connection is closed by the phone.
  6. Phone opens the Bluetooth connection and sends the results of the test to the computer in a some sort of file (yet to be determined).
  7. Computer receives file and closes connection.
  8. Results are compiled into a suitable form.

Discussion

1) The Testing.java class, is this the Hermes application? Or some other thing? Is it the class that will execute the tests?If so how are the tests saved or run?

This would be the class that executes the test. The class would read in the xml files and then run. Each test would be run my simulating events or similar. (The way you simulated the start and exit events).

2) I thought the whole point of making the mobile phone as the server was to enable automatic application deployment. Instead of manually clicking install on the phone and stuff?did i miss some part of the meeting or something?maybe i blanked out? :P

Yes that's right, the phone will automatically deploy the Testing.java class which then executes the application.

3) With the testing, the PC has our hand made XML script containing the instructions to execute, how does that fit into this? Will the test instructions somehow be loaded in with the java class (Testing.java)? - The way Mobile Life wanted us to do it was to have the PC send an instruction, one at a time (from an XML script) to the mobile application to execute. Once the mobile application executed the instruction, the result is sent back to the PC.

Sakura: The XML scripts will be loaded into a class which processes the script and then makes the appropriate test class. We could do it the way Mobile life wanted us to do if it is the best way but it seems like it would be time consuming doing it like that. Wouldn't it be easier and more efficient to process the whole thing at once and then set all the results back at once?

Sasi: Regarding the whole communication process thing you came up with. I think your right in that it would be more efficient and stuff to do it in one big chunk...my only concern is that it might seem like too much for the phone to do/handle. On the plus side, i think the way that you pointed out of doing this may be easier in terms of implementation. And also because we are just sending the testing.java class and closing the bluetooth connection...there won't be any need to look into prolonged use of bluetooth streaming (things like timeout issues etc.) However there could be a downside. Having it all deployed at once to the mobile phone could be too much for it to do. Hence if we intend to test resource usage, it could be affected by our application.

Sakura: You might be right about it being too much for the phone to handle. If this is the case then the we might have to send the code bit by bit like Mobile life wanted us to do.

4) Will the Testing.java class be part of the jar file?Like how our background processing class is part of it right now? If so then you are actually sending over the jar file correct? So the contents of the jar file are as follows:

Application.java (midlet to test) BackgroundProcessing.java (starts the background thread) Testing.java (delegates the test scripts to BackgroundProcessing.java to execute)

Is that right?

Or is the Testing.java class separate from this?

Sakura: Yes the Testing.java class will be part of the java file like our background processing class.

5)The results that get sent back, what form do you have in mind for them to be in? Is it one giant delimited string?

Sakura: I'm not sure how the results should be sent back, it should be an easy way for us to handle though so a delimited string might be a good idea.


Sasi's Research

Getting started with Java and Bluetooth

Bluetooth Application Programming with the Java APIs => e-book

The above links show the basics of using bluetooth with java. The API allows for full client and server setup for bluetooth applications. Communication is established by writing to streams, which can be opened and closed.

These are the major aspects involved in bluetooth application programming

  1. Stack Initialization
    1. Need to initialise the stack. The stack is the piece of software/firmware that controls the bluetooth device.
    2. Main purpose is to get the device ready for wireless communication
  2. Device Discovery
    1. Two main classes involved in enabling the discovery of other (remote) bluetooth devices
      1. DiscoveryAgent - Once the LocalDevice object has been retrieved, this can be instatiated via a method call.
      2. DiscoveryListener - Will notify you of when an event happens. Particularly when a device is discovered
    2. To start discovery simply call the startInquery() method on the DiscoveryAgent object.
    3. Once an object is found the deviceDiscovered() method is called within the class that implemented the DiscoveryListener interface. This method passes a that represents the device discovered by the inquiry.
  3. Device Management
    1. Two main classes involved
      1. LocalDevice - Query statistical information about your own bluetooth device
      2. RemoteDevice - Query statistical information about device in your area
    2. Every bluetooth device has a unique address. Can be obtained by a method call once the LocalDevice object is retrieved.
    3. Similarly to allow for other devices to find you, then a method call to setDiscoverable() can be done on the LocalDevice object.
  4. Service Discovery
    1. Once you have found the device, you would like to know what services it offers.
    2. Can use the DiscoveryAgent object to search for services on a RemoteDevice.
    3. Before a bluetooth device can use these services, the service will need to registered with the server first => Service Registration.
  5. Communication
    1. Server Side: Need to open the connection for the bluetooth device that will act as the server. Specified by a URL.
    2. Client Side: Creates a stream connection to the specified URL of the service object retrieved earlier.


◄ Main Page