java-me

How to change default text color of application?

旧城冷巷雨未停 提交于 2019-12-25 08:42:45
问题 How can I set text color of all Fields to white? 回答1: AFAIK, there is no such option in BB API. You can only override Field.paint(Grahpics grahpics) , smth like this: ... public void paint(Grahpics grahpics) { int initialColor = grahpics.getColor(); // just in case grahpics.setColor(Color.WHITE); super.paint(grahpics); grahpics.setColor(initialColor); } ... So you could create a set of custom white-colored Fields (WhiteLabelField, WhiteEditField, etc.) and use them istead of the originals. 来源

Calculate HTTPS POST Request size

99封情书 提交于 2019-12-25 08:29:57
问题 I have a middlet that sends data to a servlet. Anyone knows how can I calculate the size of request of the middlet in a servlet? I'm tring to sum of request header + request size + certificate size Is it correct? With this I'm trying to recreate the request: http://wikis.sun.com/display/WebServerdocs/Analyzing+SSL+Requests+and+Responses 回答1: I'm pretty sure that there is no simple way. In fact, I'm not even sure this is a meaningful thing to measure. The request header and body are part of

yyyy-mm-dd and hh:mm (PM/AM) convert into long

和自甴很熟 提交于 2019-12-25 08:27:38
问题 I have two strings: String date = "2011-11-11" String time="11:00 PM" i want to merge this date and time and convert them into a long, similar to System.currentTimeMillis(). 回答1: try this it is working fine String inputDate=date+" "+time ;; long parsedDate = HttpDateParser.parse(inputDate);//inputDate should 2011-12-11 11:10:00 PM" formate System.out.println("========================="+parsedDate); Date date=new Date(parsedDate); SimpleDateFormat date1=new SimpleDateFormat("yyyy-mm-dd hh:mm

How to prevent a List Field from showing duplicate data after auto-refresh

前提是你 提交于 2019-12-25 07:37:50
问题 I used the code below to refresh a List Field with data returned from an xml web service every minute. But after first refresh, the data duplicates. How do I prevent it from duplicating? public final class MyScreen extends MainScreen implements ListFieldCallback { ResponseHandler handler = new ResponseHandler(); ListField listUsers = new ListField(handler.getItem().size()); Manager mainManager = getMainManager(); protected void onUiEngineAttached(boolean attached) { if (attached) { Timer

Refresh Screen to Update ListField with new Data

为君一笑 提交于 2019-12-25 06:39:10
问题 I am using a ListField Control to display data returned from xml webservice. I want to refresh the ListField or the screen every minute to update the ListField with new records or data. I tried using the code below but it is not working properly (It is hanging). public MyApp() { // Push a screen onto the UI stack for rendering. UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { UiApplication.getUiApplication().pushScreen(new MyScreen()); } },5000,true); }

Blackberry add border to image when focus

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 06:39:08
问题 I'm trying to make touchable image which can focus when I scroll it by touchable button on device this is my code for touchable image: class TouchBitmapField extends BitmapField { Bitmap bitmap; boolean second; int width; public TouchBitmapField(Bitmap startBitmap, long style, int width, boolean second) { super(startBitmap, style); this.second = second; bitmap = startBitmap; this.width = width; } protected void drawFocus(Graphics g, boolean on){ g.setDrawingStyle(Graphics.DRAWSTYLE_FOCUS,

J2ME RTSP Video Streams but no Audio

徘徊边缘 提交于 2019-12-25 05:23:21
问题 I've followed Nokia's wiki about creating the video player with J2Me. Generally the code is like these player = Manager.createPlayer("rtsp://v1.cache5.c.youtube.com/CjYLENy73wIaLQm8E_KpEOI9cxMYDSANFEIJbXYtZ29vZ2xlSARSBXdhdGNoYLm0hv_ig5HRTww=/0/0/0/video.3gp"); //A player listener is needed so that we know, when the video has reached the END_OF_MEDIA position player.addPlayerListener(this); player.realize(); player.prefetch(); //The duration of the video duration = player.getDuration(); //The

J2ME RTSP Video Streams but no Audio

独自空忆成欢 提交于 2019-12-25 05:23:06
问题 I've followed Nokia's wiki about creating the video player with J2Me. Generally the code is like these player = Manager.createPlayer("rtsp://v1.cache5.c.youtube.com/CjYLENy73wIaLQm8E_KpEOI9cxMYDSANFEIJbXYtZ29vZ2xlSARSBXdhdGNoYLm0hv_ig5HRTww=/0/0/0/video.3gp"); //A player listener is needed so that we know, when the video has reached the END_OF_MEDIA position player.addPlayerListener(this); player.realize(); player.prefetch(); //The duration of the video duration = player.getDuration(); //The

HTML text extraction in j2me without any HTML tags and special characters

六眼飞鱼酱① 提交于 2019-12-25 05:18:33
问题 I have a string from an RSS file after parsing. String htmlString= <p><img border="1" align="left" width="200" vspace="2" hspace="2" height="133" alt="Prime Minister Manmohan Singh will leave for Iran on August 28, 2012 to attend the Non-Aligned Movement summit, which will be preceded by crucial bilateral talks with Iran’s supreme leader Ayotollah Ali Khamenei and Iranian President Mahmoud Ahmadinejad." src="/tmdbuserfiles/manmohan ahmadi(3).jpg" />Prime Minister summit, which will be

J2ME app File size

柔情痞子 提交于 2019-12-25 04:54:17
问题 i have doing j2me app using LWUIT lib. it get nearly 600kb. then i have use net-bean default Obfuscation tool. but still it size is not less than 430kb. any idea? 回答1: check your resources, they might be too large. Also make sure there aren't any hidden files in your jar file, for example make sure the Thumps.db which generated in windows is not there! 来源: https://stackoverflow.com/questions/3931422/j2me-app-file-size