Hi all,
in my country (Italy) three different carriers

are offering mobile TV by means of DVB-H.
It is really disappointing that all the mobile phones sold until now are "broadcast locked" by each carrier (meaning that it is not possible to have mobile TV from an operator by using the phone branded by another one, simply by exchanging the SIM card).
In my opinion, it is a matter of the custom application inside each branded phone, devoted to manage the channel list and the ESG broadcasted by each carier. If this is true, chanches are to bypass this limitation by developing an "open" J2ME app relying on
JSR-272 ("Mobile Broadcast Service API").
What do you think about that ?
Have you some experience on using JSR-272 on DVB-H capable phones
Thanks
Hereunder I report an example of code based on the J2ME Mobile Broadcast Service API
Code:
1. Identifying the underlying bearer, ESG spec used in the implementation:
import javax.microedition.broadcast.esg;
ServiceGuide esg = ServiceGuide.getDefaultServiceGuide();
MetadataSet spec;
MetadataSet[] speclist = esg.getSupportedMetadataSets();
for (int i = 0; i < speclist.length; i++) {
System.out.println("Metadata Specification: " +
speclist[i].getDescription());
// Check the class for the different types of spec; DVBH in this case.
if (speclist[i] instanceof CommonMetadataSet) {
// ....
}
}
2. Enumerate all the valid attributes in the specs:
ServiceGuide esg = ServiceGuide.getDefaultServiceGuide();
MetadataSet spec;
MetadataSet[] speclist = esg.getSupportedMetadataSets();
for (int i = 0; i < speclist.length; i++) {
Attribute[] attrs = speclist[i].getValidAttributes();
for (int j = 0; j < attrs.length; j++) {
// Eumerate the attributes and print out their long (proper) names.
System.out.println("Attribute: " + attrs[j].getName());
}
}
3. Find all the programs of a particular genre, then display it:
// Form the query
ServiceGuide esg = ServiceGuide.getDefaultServiceGuide();
Query q = QueryComposer.equivalent(CommonMetadataSet.PROGRAM_CONTENT_GENRE, "News");
// Because some programs of our interest may be updated asynchronously,
// we should also add a listener to make sure that we get updated
// on all the programs we are interested in.
// We'll go through this in Example 4.
try {
esg.addListener(new ProgramMonitor(), q);
} catch (QueryException qe) {
// invalid query
}
ProgramEvent programs[];
try {
// Find the programs
programs = esg.findPrograms(q);
for (int i = 0; i < programs.length; i++) {
// A custom function to display the program info
// Example 5.
displayProgramInfo(programs[i]);
}
} catch (QueryException e) {
}
4. Listen to program updates:
// Define my own program change listener for monitoring
// program updates.
class ProgramMonitor implements ServiceGuideListener {
public void serviceGuideUpdated(String event, ServiceGuideData esgdata, Object data) {
if (event == NEW_PROGRAM_LISTED || event == PROGRAM_CHANGED) {
// Display the new program
displayProgramInfo(esgdata);
}
else if (event == SERVICE_GUIDE_BULK_CHANGED || event == PROGRAM_DELETED) {
// We'll need to redo the queries and redisplay
// the programs. See Example 3.
}
}
}
5. Display "Generic" program information:
void displayProgramInfo(ProgramEvent p) {
ServiceGuide esg = ServiceGuide.getDefaultServiceGuide();
// Use the code in example 2 to find all the applicable attributes
// for a program.
MetadataSet[] speclist = esg.getSupportedMetadataSets();
Attribute[] attrs = speclist[0].getValidAttributes();
for (int i = 0; i < attrs.length; i++) {
// Since we do not know ahead of time what the type
// of the attributes are, we will need to test for
// them one by one with "instanceof".
// The following format* methods format and display the
// values in some meaningful ways in the GUI. They are
// left as exercise for the readers.
formatAttribute(attrs[i].getName());
if (attrs[i] instanceof StringAttribute) {
formatString(p.getValue((StringAttribute)attrs[i]));
}
else if (attrs[i] instanceof DateAttribute) {
formatDate(p.getValue((DateAttribute)attrs[i]));
}
// More...
}
}