Android Open Handset Developers Community

 
Guest Announcements

:arrow: Welcome: you are not yet registered; you can register here.
:arrow: A new forum on the new HTC Magic is available here.

It is currently Fri Feb 10, 2012 9:43 am

All times are UTC


 Topics   Replies   Views   Last post 
No new posts Mobile TV over DVB-H and broadcast lock ...

by barban on Thu Dec 27, 2007 7:01 pm in DVB-H

0

702

Thu Dec 27, 2007 7:01 pm

barban




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Mobile TV over DVB-H and broadcast lock ...
PostPosted: Thu Dec 27, 2007 7:01 pm 
Offline

Joined: Thu Dec 27, 2007 6:09 pm
Posts: 65
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 ? :mrgreen:

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...
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
phpBB SEO

This site is not affiliated with nor endorsed by the Open Handset Alliance.
All trademarks and logos used in this site are of properties of their respective owners.