You Are Here:

Community: Developer Discussion Boards

#1 Old Determing MMAPI on Series40 - 2003-10-23, 20:16

Join Date: Mar 2003
Posts: 18
mauricesibrandi
Offline
Registered User
Hi,

I want my Series40 game to play Midi when possible, so what I did after browsing the forums, some tips on Google, etc is this.

I created a MidiPlayer class which looks like this:

import javax.microedition.media.*;

class MidiPlayer extends Object
{
// everything to open/play a midi file
}


in the game I do this:

try
{
Class.forName("javax.microedition.media.control.VolumeControl");
Class c = Class.forName("MidiPlayer");

Object media = c.newInstance();
((IMedia)media).init("test.mid");
((IMedia)media).play(1);
}
catch (ClassNotFoundException e)
{
System.out.println("no midi support");
}

I compile using the 3300 SDK so there is MMAPI in the classes.zip.


When I run this on the 3300 emulator everythings works fine. If I run it on the 7210 emulator or on a real phone it says "Cannot create class in the system package". It does that on the line Class.forName("javax.microedition.media.control.VolumeControl");

How come? Isn't the Class.forName check not suitable for this case? And if not, how should you determine wheter MMAPI is available.

If I leave out the code in the game, it will start on a 7210. So I guess the Class.forName succeeds because there are references to the VolumeControl, but I don't use them in MidiPlayer.


Maurice
Last edited by mauricesibrandi : 2003-10-23 at 20:26.
Reply With Quote

#2 Old 2003-10-29, 12:04

Join Date: Mar 2003
Posts: 15
Location: Finland
sampoy
Offline
Registered User
Im not sure, but "Cannot create class in a system package" could be generated because you import javax.microedition.media.* and the classloader does not find the package.
Reply With Quote

#3 Old 2003-10-29, 12:54

Join Date: Mar 2003
Posts: 18
mauricesibrandi
Offline
Registered User
That's what the Class.forName method should take care of but there is a problem with that method. (see http://discussion.forum.nokia.com/fo...threadid=31734)

Maurice
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: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X 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