You Are Here:

Community: Developer Discussion Boards

#1 Old Detecting supported configurations - 2005-04-06, 06:58

Join Date: Mar 2003
Posts: 41
Location: Brisbane, Australia
ghauber
Offline
Registered User
Hi,

I am trying to write some generic sound code that adapts itself to the capabilities of the phone on which it is running. For example, I have the following code:
Code:
try {
    Class c = Class.forName("javax.microedition.media.Player");
    // . . . MMAPI is supported
} catch (ClassNotFoundException cnfe) {
    // . . . no MMAPI, fall back on NokiaUI Sound lib
}
Using the various Nokia SDKs, this seems to work fine, except on the Nokia 7210 MIDP SDK 1.0, where I get the error "Cannot create class in system package" and the application will not start.

Does anyone know if the failure is just a problem with this SDK (and possibly others), or does it also occur on the phone in question? If the problem is also on the phone, is there another way to test for API support (i.e. presence of MM API) that works?

Thanks,

Gabriel
Reply With Quote

#2 Old 2005-04-09, 13:20

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
This is a bug in early Nokia Series 40 devices. They fail on forName where the class begins with "java.", "javax.", "com.sun." or "com.nokia.". Unfortunately, this makes it impossible to detect APIs correctly on these devices.

Cheers,
Graham.
Reply With Quote

#3 Old 2005-04-11, 01:19

Join Date: Mar 2003
Posts: 41
Location: Brisbane, Australia
ghauber
Offline
Registered User
Hi Graham,

Thanks for the reply. So, basically I take it that I can use this method safely on anything but Nokia Series 40 dev platform 1.0 devices?

Regards,

Gabriel
Reply With Quote

#4 Old 2005-04-11, 14:58

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
If I remember right, it even works on most Series 40s, just not the earlier 7210s.

I should say, you may find it difficult to create a single build for more than a handful of devices, unless your application does not stretch things too far (and, having sound comes under the heading of "stretching"!). Even phones with MMA tend to be inconsistent in their implementation. (On some phones you must deallocate the sound after playing, or other sounds won't play; on others you must not deallocate it, or it won't play again; on others, you must trash the player instance and re-create it each time.)

Cheers,
Graham.
Reply With Quote

#5 Old 2005-04-11, 15:16

Join Date: Mar 2003
Posts: 41
Location: Brisbane, Australia
ghauber
Offline
Registered User
Quote:
Originally posted by grahamhughes
Even phones with MMA tend to be inconsistent in their implementation. (On some phones you must deallocate the sound after playing, or other sounds won't play; on others you must not deallocate it, or it won't play again; on others, you must trash the player instance and re-create it each time.)
Oh.

Has anyone compiled a list somewhere of which devices do what in this regard?
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ