A J2ME and MIDP 2 question
2 Questions
1. If I have a sprite on a layer but the layer manager is only showing a part of the layer and the sprite is not on that part of the screen are any resources being taken up by the sprite? If so what would be a good way to manage sprites (in this case enemies) that have a predetermined position on the much larger layer that need to be added to the layer when the screen is visible?
2. What is the largest size I can use for a image that I am going to be using as my game area?
1: yes, the sprite is using resources. it uses space from the offscreen buffer.
i suppose that you are a game buff. there are two types of having bbiigg maps. one is zelda type (gbc). and the other is pokemon type(gbc). in zelda type, each screen is one layer, and you move from screen to screen by moving from layer to layer, with a 2d matrix of layers coming together to make a map.
in pokemon type, there is one bbbbbbbbbbiiiiiiiiiigggggggggg layer through which you scroll smoothly. this is tougher. best is to have a condition for each sprite like isVisible. if it is false, suspend all animations for that sprite. if it is on the screen, start it's animation.
You can divide this into smaller layers by using tricks like 'doors' through which you pass through to go to other layers. never have a layer too big because it will kill performance.
for an image the largest size can be indeterminate, as long as you have the space for it on the heap. also only a part of it as large as the screen size can be displayed at once.
hope this helps
Arjun
Similar Messages
-
J2ME and MIDP beginner questions
Can anyone recommend editor/IDE, toolkit etc. for coding, building and testing MIDP2.0 apps/games?
Until now I've coded a game using J2SE. I used Forte 3.0 for coding and compiling, and IE5.5 for testing.
Now I want to code mobile games/apps using J2ME and MIDP 2.0. What software do I need? I downloaded Sun ONE studio 4 ME and wireless toolkit 2.0, but are kind of struggeling with it :)
Regards
HallvardOk, I found out that the toolkit compiled the .java files and could bulid the .jar and .jad files, and then test the MIDLet on the emulator.
But what about a good editor/IDE for MIDLets? In Sun ONE studio ME i finally managed to create a HelloWorld Midlet (with new project wizard), and build and run it in the toolkit.
I also heard that Borland JBuilder Mobile Edition was a nice IDE for J2ME/MIDLets.
Hallvard -
JAR packages with J2ME and MIDP devices
Some devices that use J2ME have limitted the size of java applications.
Here's an example, device has 120 Kb of memory, but max. size of downloadable app is 30 Kb. Is it possible to make JAR packages like in J2SE so that the the application (the classes of the app) are devided to two or more JARs and get it work. Since this is an easy workaround this limit.
In J2SE grouping app into many JARs is possible if I am right.. JAR-docs propably quides my way... I am just wondering if this is possible J2ME
P_TRyou may use the special .jar tool to do it.
www.pivotonic.com
JavaJar1.1
you can add files to .jar file like winzip.
and you can edit and check correct the manifest file in JavaJar editor.
why not try it? -
J2me wireless toolkit and MIDP,CLDC
Hi,
does the j2me wireless toolkit ship the cldc and midp with it ?why email, thats a forum because there are more people interested in problems and their solution than you.
The 2.2beta also ships with the CLDC 1.1 and MIDP 2.0. Its a must because without it, you wouldnt be able to execute anything. And you cant put the JVM, MIDP and CLDC on your phone. The only thing you need is your application. The rest is implemented in hardware (or firmware of the phone). If not, theres no way to ''manually'' put in there (this includes upgrading).
hth
Kay -
Bluetooth connection not working on US Nokia phones from J2ME Midlet (MIDP
Hi All,
We are developing a J2ME midlet (MIDP 2.0 ,CLDC 1.1)which makes bluetooth connection to other devices.The bluetooth
connection is working perfectly on indian nokia phones with Airtel as carrier.But when we deploy the same midlet on Nokia E71
US phone with carrier as AT&T ,the bluetooth connection is not working.The sample code is as follows:
public void run(){
try{
StreamConnection connection = (StreamConnection)Connector.open(btConnectionURL);
// open an input stream to get some data
InputStream in = connection.openInputStream();
byte[] serialData;
readData = true;
while(readData == true){
int lengthavai=0;
lengthavai = in.available();
if(lengthavai > 0){
serialData = new byte[lengthavai];
int length = in.read(serialData);
System.out.println("data read: " + new String(serialData));
dataViewForm.append(new String(serialData));
in.close();
connection.close();
}catch(IOException ioe){
ioe.printStackTrace();
when we try to connect on US Phones],the execution hangs at the following line of code:
StreamConnection connection = (StreamConnection)Connector.open(btConnectionURL);
No exception is caught.
Our midlet is not signed.
In the Forums it is said that the problem is with the unsigned midlet.AS some of the US carriers block the secure API usage
on Unsigned midlet.
But our question is, if we buy a code signing certificate from Verisign or Thawte and sign the midlet, will this problem be solved.
Any other alternative solutions for this ???
Immediate help will be appreciated.
Thanks,
YashYou might want to read this before buying a certificate:
http://javablog.co.uk/2007/08/09/how-midlet-signing-is-killing-j2me/
It's not my blog, but I pretty much agree with what it says. Unfortunately the network operators can control the access 3rd party trusted certificates have, so even if you sign with Verisign for example, the signed midlet may not have any more privileges than an unsigned midlet, depending on network. They do this so that only midlets signed with one of their own certificates have unrestricted privileges forcing anyone who wants a useful application to buy it from the network instead of downloading an equivalent freeware version from Getjar for example. Some networks are worse than others, so signing your midlet will allow it to work on more phones than an unsigned midlet. I think Verisign have some info on AT&T on their website.
The whole MIDP specification for security is a joke, IMHO. I don't mind unsigned midlets flashing up a warning once during an application. Writing 20 files, for example, will give 40 security warnings for reading writing data which is ridiculous, as the user obviously either trusts the app or he doesn't. No one runs an app that they only sometimes trust.
As far as I know the only mobile manufacturer so far to see sense is Sony Ericsson. All of their new phones from Java platform 7 onwards allow unsigned applications access to the file system, bluetooth etc with just one warning when the applications starts.
Andy -
J2ME CLDC/MIDP emulator for Compaq iPAQ
I would like to run J2ME CLDC with MIDP on my Compaq iPAQ 3650. I am NOT interested in PersonalJava at this time. I have two questions:
1. Has anyone tried to put the J2ME Wireless Toolkit emulator on iPAQ, with or without Swing? J2ME WTK currently requires Swing, but it seems like that AWT may be used exclusively instead with some slight modifications.
2. Does anyone know if there is an applet/AWT version of a J2ME CLDC/MIDP emulator that I can use for demos?
Thanks.You can use the PalmOS emulator for winCE and install MIDP4PALM...
-
I'm not sure which forum this should go in so applogies if I got it wrong.
I would like to use the java.nio package from JDK1.4 with the J2ME. Is this possible in any way?
cheers
AndrewI'm not sure which forum this should go in so
applogies if I got it wrong.
I would like to use the java.nio package from JDK1.4
with the J2ME. Is this possible in any way?this topic should be post at
CLDC and MIDP
http://forum.java.sun.com/forum.jsp?forum=76
or
K Virtual Machine (KVM)
http://forum.java.sun.com/forum.jsp?forum=50
CLDC 1.0 and MIDP 1.0 doesn't include java.nio
please go to
http://java.sun.com/j2me/docs/
two documents will be useful
CLDC Specification, V1.0
MIDP 1.0 Specification, Final (JSR 37) -
J2ME And JSP...
Hi there Experts...
i am new to J2ME and i need to connect my MIDP forms to jsp..
i dont have any idea about that. Is it possible to pass values those been selected by an user from mobile device to the jsp and again answer from jsp to he mobile device..?
Please help me out...
AgamHi,
Here is the example of HttpConnection Class
HttpConnection conn = (HttpConnection)Connector.open("http://www.yourdomain.com/mypage.jsp");
InputStream is = new InputStream(conn.openInputStream());and now you can read is as you want and extract data from it.
is can also contain XML data and then you can use XML parsers to extract data.
Now it you wanna send any parameter using querystring then you should write like this
HttpConnection conn = (HttpConnection)Connector.open("http://www.yourdomain.com/mypage.jsp?fname=rohan&lname=chandane");
InputStream is = new InputStream(conn.openInputStream());Regards,
Rohan Chandane -
hello, i had trouble with streaming mp3 files from wirelesstolkit2.2 aplication.
my question, is j2me with MIDP 2.0 support mp3 file streaming?
thanks,
mdaniHi, I have also encountered same kind of problem. i tried with simple url like http://localhost/test/200.mp3. It did not work in my application. so i have used the same url in the enter url option of the demo program. Even this did not work. Can anyone please let me know, how to play mp3 files.
I had used tomcat to serve the requested operation. if i enter the above url in browser then its opening, but not in MIDP application.
I got the following exception.
javax.microedition.media.MediaException: Player cannot be created for http://localhost/test/200.mp3.
Please help me out.
mail id: [email protected]
thanks in advance
pavan. -
Account with an icon of a face and a question mark
Same issue of other user in Yosemite Apple Support.
Following advises on that thread I also installed the ETRECHECK software tool, report is as follows:
Problem description:
At the login screen I find an icon with a face and a question mark in it - with a message it needs an update.
EtreCheck version: 2.1.5 (108)
Report generated 02 gennaio 2015 12:37:26 CET
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Click the [Adware] links for help removing adware.
Hardware Information: ℹ️
MacBook Pro (13-inch, Mid 2012) (Verified)
MacBook Pro - model: MacBookPro9,2
1 2.5 GHz Intel Core i5 CPU: 2-core
16 GB RAM Upgradeable
BANK 0/DIMM0
8 GB DDR3 1600 MHz ok
BANK 1/DIMM0
8 GB DDR3 1600 MHz ok
Bluetooth: Good - Handoff/Airdrop2 supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
Intel HD Graphics 4000
Color LCD 1280 x 800
System Software: ℹ️
OS X 10.10.1 (14B25) - Uptime: 1:22:54
Disk Information: ℹ️
APPLE HDD HTS545050A7E362 disk0 : (500,11 GB)
EFI (disk0s1) <not mounted> : 210 MB
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
Macintosh HD (disk1) / : 498.89 GB (467.03 GB free)
Encrypted AES-XTS Unlocked
Core Storage: disk0s2 499.25 GB Online
MATSHITADVD-R UJ-8A8
USB Information: ℹ️
Apple Inc. FaceTime HD Camera (Built-in)
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM20702 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. Apple Internal Keyboard / Trackpad
Thunderbolt Information: ℹ️
Apple Inc. thunderbolt_bus
Gatekeeper: ℹ️
Mac App Store and identified developers
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist [Support]
User Login Items: ℹ️
iTunesHelper Applicazione (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
Dropbox ApplicazioneHidden (/Applications/Dropbox.app)
Internet Plug-ins: ℹ️
FlashPlayer-10.6: Version: 16.0.0.235 - SDK 10.6 [Support]
Flash Player: Version: 16.0.0.235 - SDK 10.6 [Support]
QuickTime Plugin: Version: 7.7.3
Default Browser: Version: 600 - SDK 10.10
Safari Extensions: ℹ️
Pin It Button [Installed]
Save to Pocket [Installed]
Add To Amazon Wish List [Installed]
3rd Party Preference Panes: ℹ️
Flash Player [Support]
Time Machine: ℹ️
Time Machine not configured!
Top Processes by CPU: ℹ️
14% WindowServer
3% hidd
2% Safari
1% Dock
0% fontd
Top Processes by Memory: ℹ️
333 MB com.apple.WebKit.WebContent
155 MB mds_stores
137 MB Safari
137 MB Finder
86 MB Dropbox
Virtual Memory Information: ℹ️
7.76 GB Free RAM
4.88 GB Active RAM
3.28 GB Inactive RAM
1.26 GB Wired RAM
4.73 GB Page-ins
0 B Page-outs
Diagnostics Information: ℹ️
Jan 2, 2015, 11:15:06 AM Self test - passed
Jan 2, 2015, 12:06:57 AM /Library/Logs/DiagnosticReports/Dropbox109_2015-01-02-000657_[redacted].cpu_res ource.diag [Details]
---------- is there any troubleshooting for delete that fake account every time I start my Macbook Pro?
thanks and regards
EdoardoSmiley face with a ? means a bootable system is not found.
There maybe a problem with either system software or hard drive itself.
Try this.
Repair Disk
Steps 2 through 8
http://support.apple.com/kb/PH5836
Best. -
J2me and java card, need help to communicate
we are trying to put together a reader to read smartcards using j2me and we figure that it would be easiest if we could develop it to work with java cards rather than standard smart cards, the problem is we get garbage when we communicate to it, the chip sends us crap, any suggestions what might be wrong, any calls we might be missing, has anyone worked with j2me and java cards or smart cards, any help would be appreciated.
einar.... reader app and the ME behind it .... smells like mobile ....
First of all - if you want to have one mobile application running on this just make sure that whatever is written in ME can use drivers from the reader chip ....
Workin on the PC is something completely different. There was one good example how to develop one host application in Java provided with the JCOP tools long ago ... I don't know if this is now in the new Eclipse tools.
But - there was a small API provided that can give you good hints what to do - and - once you have it on the reader side - you can easily integrate ME methods with this ... -
Performance issue and functional question regarding updates on tables
A person at my site wrote some code to update a custom field on the MARC table that was being copied from the MARA table. Here is what I would have expected to see as the code. Assume that both sets of code have a parameter called p_werks which is the plant in question.
data : commit_count type i.
select matnr zfield from mara into (wa_marc-matnr, wa_marc-zfield).
update marc set zfield = wa_marc-zfield
where werks = p_werks and matnr = wa_matnr.
commit work and wait.
endselect.
I would have committed every 200 rows instead of every one row, but here's the actual code and my question isn't around the commits but something else. In this case an internal table was built with two elements - MATNR and WERKS - could have done that above too, but that's not my question.
DO.
" Lock the record that needs to be update with material creation date
CALL FUNCTION 'ENQUEUE_EMMARCS'
EXPORTING
mode_marc = 'S'
mandt = sy-mandt
matnr = wa_marc-matnr
werks = wa_marc-werks
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
" Wait, if the records not able to perform as lock
CALL FUNCTION 'RZL_SLEEP'.
ELSE.
EXIT.
ENDIF.
ENDDO.
" Update the record in the table MARC with material creation date
UPDATE marc SET zzdate = wa_mara-zzdate
WHERE matnr = wa_mara-matnr AND
werks = wa_marc-werks. " IN s_werks.
IF sy-subrc EQ 0.
" Save record in the database table MARC
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = wa_return.
wa_log-matnr = wa_marc-matnr.
wa_log-werks = wa_marc-werks.
wa_log-type = 'S'.
" text-010 - 'Material creation date has updated'.
wa_log-message = text-010.
wa_log-zzdate = wa_mara-zzdate.
APPEND wa_log TO tb_log.
CLEAR: wa_return,wa_log.
ELSE.
" Roll back the record(un save), if there is any issue occurs
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
return = wa_return.
wa_log-matnr = wa_marc-matnr.
wa_log-werks = wa_marc-werks.
wa_log-type = 'E'.
" 'Material creation date does not updated'.
wa_log-message = text-011.
wa_log-zzdate = wa_mara-zzdate..
APPEND wa_log TO tb_log.
CLEAR: wa_return, wa_log.
ENDIF.
" Unlock the record from data base
CALL FUNCTION 'DEQUEUE_EMMARCS'
EXPORTING
mode_marc = 'S'
mandt = sy-mandt
matnr = wa_marc-matnr
werks = wa_marc-werks.
ENDIF.
Here's the question - why did this person enqueue and dequeue explicit locks like this ? They claimed it was to prevent issues - what issues ??? Is there something special about updating tables that we don't know about ? We've actually seen it where the system runs out of these ENQUEUE locks.
Before you all go off the deep end and ask why not just do the update, keep in mind that you don't want to update a million + rows and then do a commit either - that locks up the entire table!The ENQUEUE lock insure that another program called by another user will not update the data at the same time, so preventing database coherence to be lost. In fact, another user on a SAP correct transaction, has read the record and locked it, so when it will be updated your modifications will be lost, also you could override modifications made by another user in another luw.
You cannot use a COMMIT WORK in a SELECT - ENDSELECT, because COMMIT WORK will close each and every opened database cursor, so your first idea would dump after the first update. (so the internal table is mandatory)
Go through some documentation like [Updates in the R/3 System (BC-CST-UP)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf]
Regards -
How can i restore my iphone 5s as i forgot my icloud password and sec questions
I bought a new iphone 5s (32G Gold)
and when I connect it to itunes asked me to restore from my old iphone 4
with all my account settings and passwords.
but I have a problem with my account for icloud password and security questions because my cloude id is *************** and with no problem with my apple id "*****************", I tried to restore my new iphone after I turned off find my iphone from icloud setting and when its restore was finished the iphone is locked and asked me to unlock the iphone with a ****************** that I forget the password and security questions and when I tried to enter my account id "**************** with no problem with its password it says to me "this account can't unlock this iphone"
when I visit tradeline (Apple products dealer) I found no answer and they adviced me to contact apple directly.
Name : Alaa Rashed Abd el Hafiz
Country : egypt
<Personal Information Edited by Host>First, remove your personal information from your post. That's not needed here. This is a public forum, and it is unwise to provide your personal data online.
Second, here's how you reset your password and/or security questions.
How to reset your Apple ID password.
Go to iforgot.apple.com and type in your Apple ID, then click 'Next'.
Verify your date of birth, then click 'Next'.
You'll be able to choose one of two methods to reset your password, either E-Mail Authentication or Answer Security Questions.
If neither method works, then go to https://getsupport.apple.com
(If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
Choose 'More Products & Services', then 'Apple ID'.
A new page will open.
Choose 'Other Apple ID Topics', then 'Lost or forgotten Apple ID password'.
Click the blue 'Continue' button.
Select the contact option that suits your needs best.
How to reset your Apple ID security questions.
Go to appleid.apple.com, click on the blue button that says 'Manage Your Apple ID'.
Log in with your Apple ID and password. (If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email)
Go to the Password & Security section on the left side, and click on the link underneath the security questions that says 'Forgot your answers? Send reset security info email to [email]'. This will generate an automated e-mail that will allow you to reset your security questions.
If that doesn't work, or there is no rescue email link available, then click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later.
Next, go to https://getsupport.apple.com
(If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
Choose 'More Products & Services', then 'Apple ID'.
A new page will open.
Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
Click the blue 'Continue' button.
Select the contact option that suits your needs best. -
Hi, I have a new computer and new apple id. I've purchased music with my old computer, email and apple id.
I cant access now the previously purchase music, because it wants to authorize the new computer to play the
music. I cant remember password and security questions for my old id and the old email doest exist anymore.
What can I do?Hi, Carmen.
Thank you for visiting Apple Support Communities.
If you need to reset you security questions, do not know the answers and no longer have access to that email account, see the last sentence under Note in step 5.
You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need tocontact iTunes Store support in order to do so.
Rescue email address and how to reset Apple ID security questions
http://support.apple.com/kb/ht5312
Cheers,
Jason H. -
Spam filtering solution for iPhone and a question.
I've read a lot of posts about spam filtering for the iPhone and have yet another solution and a question. I use SpamSieve and I am not affiliated with them in any way. The nice thing about SpamSieve is that if it is the first rule in your Mail.app rule set any mail that follows has already been filtered. All you need to do then is create another rule that redirects email to what ever mail account you choose. Since my ISP allows multiple accounts, I will simply create an iPhone@myISP account.
Now the question. Is it possible to write an applescript that will turn the redirect rule on or off so that I don't have to dig into the rules section of Mail to get this done?
ThanksIs it possible to write an applescript that will turn the redirect rule on or off so that I don't have to dig into the rules section of Mail to get this done?
not at present time
Maybe you are looking for
-
Error Manual intervention is required to stop the members...
I'm seeing a couple errors when disconnected members try to rejoin. I've read what's here about "validate polls": http://coherence.oracle.com/display/COH35UG/Partitioned+Cache+Service+Log+Messages I think the relevant stuff is this: 2010-12-15 09:04:
-
After multiple attempts to install Itunes 11 without problems I finally got it to work
About a month ago when updating to Itunes 11, I started getting errors that would not allow me to Install the update and then when I did the program crashed when trying to open. After multiple removing/installing all the apple software per instructi
-
EJB perfomance issue while migrating from weblogic 10.0 to 10.3
Hi, I have an EJB service which I am migrating from 10.0 to 10.3 The service contains an entityManager.find() method which takes less than 2 secs to execute on 10.0 and more than 10 secs on 10.3. The code snippet and the log trace are as below -- Cod
-
Auto-Lock "Never" not available
I added an Exchange mail account and I found that the "Never" option is no longer available in *Settings > General > Auto-Lock*. This is a well-documented issue as in this article: http://www.macworld.com/article/152642/2010/07/noneverautolock.html I
-
HT203167 My App Store icon is missing from ipad and won't re-install?
My App Store icon is missing from ipad and won't re-install? You can't delete it so where is it?