Storage of data in a MIDlet using non-volatile memory (memory remains), called Record Management System (RMS). We have set records within RMS, and the record is stored as array of byte in a record store. RMS has the orientation of a simple database record so that the MIDlet can store information and access it. Different MIDlets can access the same RMS. Records stored in record store can be accessed by recordId that integer. Therefore recordId act as key. Sorting Records Comparing the record store recore needed an interface. The interface of this comparison is needed to sort a collection of records that exist in the record store. The interface of this comparison is in the RMS API called RecordComparator. Because RecordComparator is an interface then there is a method to implement when using this interface, the method is
compare (byte [] rec1, byte [] rec2) in class javax.microedition.rms.RecordComparator.
How it works RecordComparator was to compare the two methods compare an array of bytes which will return 0 if both records are the same, will produce a 1 if the first recordyang above the second record, and produce -1 if the first record under the second record. b. selecting records RMS API also provides an interface to access records search mode record.RecordFilter is the interface of the RMS API which is used to search records.RecordFIlter also has a method that must be implemented that matches (byte [] candidate), this method returns boolean (true or false) depending on whether the records meet the criteria or not.
Several methods for accessing RMS a. To Open a record store RecordStore rs = RecordStore.openRecordStore ("dbRms", true); / / For the true parameters of the above, if dbRms not then be made. b. Closing the record store rs.closeRecordStore (); RecordStore.deleteRecordStore (dbRms); c. delete the record store RecordStore.deleteRecordStore (dbRms); d. Adding records String data = "insert record"; byte bytes [] = data.getBytes (); rs.addRecord (bytes, 0, bytes.length); e. Update records on recordId 1 NewaData String = "update record"; Byte data = newaData.getBytes (); rs.setRecord (1, data 0, data.length ()); f. Deleting records in a record Id rs.deleteRecord (1); g. Enumerating records RecordEnumeration re = rs.enumerateRecords (null, null, false); If (re.hasNextElement ()) nextRec Byte [] = re.nextRecord ();
free tutorial on line
Minggu, 16 Januari 2011
understanding of motion detection
Simple motion detection can be done by finding the difference between 2 pieces of the image sequence on the results of imaging using a digital video camera. There are various methods for comparing two images. The method is simple and the process is not too heavy that is by looking for the highest pixel value differences and compare it to a limit value. If the difference is higher than the limit value, we conclude there is a difference in the second picture. For a range of different pixels is not too far then it should be greyscale first, namely by taking the value - average RGB components.
Langganan:
Postingan (Atom)