I need solution for this...
Hi all... I am a beginner in blackberry development.
The code below is every time we click the ok button, it retrieves the content of the
Saran.txt the SD card file and displays them on the screen. So far so good, but the problem
is whenever I click on ok again, the content is displayed again. I don't want it to be
displayed again instead, I want that he should be replaced. I am facing this kind of problem with all areas
that appears on the screen, that is to say, the second time I click the button only one copy of this field is
display again.
can someone suggest a solution for this...
package myText; import java.io.*; import javax.microedition.io.Connector; import javax.microedition.io.HttpConnection; import javax.microedition.io.file.FileConnection; import net.rim.device.api.io.transport.ConnectionDescriptor; import net.rim.device.api.io.transport.ConnectionFactory; import net.rim.device.api.system.Bitmap; import net.rim.device.api.system.EncodedImage; import net.rim.device.api.system.PNGEncodedImage; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.ui.*; public class myText extends UiApplication { public static void main(String[] args) throws IOException { myText theApp = new myText(); theApp.enterEventDispatcher(); } public myText() throws IOException { new Textdisplay(); } } final class Textdisplay implements FieldChangeListener { MainScreen mainScreen=new MainScreen(); ButtonField ok=new ButtonField("OK"); //HttpConnection hc; //String url = "http://wordpress.org/extend/plugins/about/readme.txt"; //InputStream is=null; public Textdisplay() throws IOException { UiApplication.getUiApplication().pushScreen(mainScreen); mainScreen.setTitle("Text file Fetching......"); mainScreen.add(ok); ok.setChangeListener(this); } /*public void downloading() throws IOException { ConnectionFactory connFact = new ConnectionFactory(); ConnectionDescriptor connDesc; connDesc = connFact.getConnection(url); if (connDesc != null) { HttpConnection httpConn; httpConn = (HttpConnection)connDesc.getConnection(); try { final int iResponseCode = httpConn.getResponseCode(); Dialog.alert("Response.. code: "+Integer.toString(iResponseCode)); mainScreen.add(new LabelField(httpConn.getHost()+"\n"+httpConn.getRequestMethod())); is=httpConn.openInputStream(); StringBuffer buffer= new StringBuffer(); int chars; while((chars = is.read()) != -1) { buffer.append((char) chars); } String text = new String(buffer); mainScreen.add(new LabelField(text)); } catch (IOException e) { System.err.println("Caught IOException: " + e.getMessage()); } } } */ public void Fetching() throws IOException { String path = "file:///SDCard/BlackBerry/textfiles/saran.txt"; FileConnection FileConn=null; InputStream is=null; TextField label = null; int chars; Dialog.alert("entering"); try{ FileConn = (FileConnection) Connector.open(path,Connector.READ); Dialog.alert("file connection"); if(!FileConn.exists()){ FileConn.create(); } Dialog.alert("connection created"); //int length = (int) FileConn.fileSize(); //byte[] data = new byte[length]; is = FileConn.openInputStream(); //dis.readFully(data); Dialog.alert("not yet"); StringBuffer buffer= new StringBuffer(); while((chars = is.read()) != -1) { buffer.append((char) chars); } String text = new String(buffer); Dialog.alert("Click to read data......."); label.setText(text); mainScreen.add(label); is.close(); } catch(Exception e){ System.out.println("file not found:" + e); Dialog.alert("file not found"+e); } finally { try{ FileConn.close(); } catch(Exception e){} } } public void fieldChanged(Field f, int context) { try { //Dialog.alert("Fetching the file......."); mainScreen.add(new LabelField("Fetching the data...........")); Fetching(); } catch (Exception e) { e.printStackTrace(); } } }
In your current code, ButtonField 'ok' is global, so you can refer to this anywhere. Add a BitmapField which is overall too. And then in your transformation, set this to the new Bitmap that you created and invalidate the screen (mainScreen.invalidate ()).
If you add a BitmapField and it doesn't have a bitmap, it will not display.
Tags: BlackBerry Developers
Similar Questions
-
After the upgrade to windows 10, my dreamweaver has stopped working. It starst and lasts 30 seconds and never work again.
Could someone give me a solution for this? I really need DW!
Problems during the installation or opening Dreamweaver on Windows 10
-
get this problem in win 2 k 8 32-bit enterprose
Need solution for the details of the error below: -.
Blue screen error BCCode 1000008e + BCP1:80000003 + BCP2:817855 A 8 + BCP3:8B9B9A54 + BCP4:00000000 + OS version: 6_0_6001Hi SudhaArunachalam,
Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows Server forum.
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
-
I have a toshiba laptop purchased recently. After the scheduled updates it does not recognize the wireless network. I have to do a system restore. is there a solution for this problem?
Hello
Make sure you have the latest network adapter drivers fron toshiba
http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/home.jsp
and if windows update is at the origin of the problem change how to get updates to uncover the problem update
When you have found the issue, a right click on it then invited uac then hide
read the information on the link below
http://www.bleepingcomputer.com/tutorials/tutorial140.html
Download updates but let me choose whether to install them - if you select this option, Windows will download the updates on your computer, but not install them automatically. If you want to install updates, then you must install them manually. You should only select this option if you have a reason to not install updates automatically. Only advanced users should use this option.
Check for updates but let me choose whether to download and install them - if you select this option, you'll be alerted when there are new updates available for download and install. You can then choose to download and install the updates that you want. This option should really be reserved for people who know exactly which updates they need, or those who have little access to the Internet.
-
I have a 4TB vdisk and it occupies space is 2 TB and the remaining space is free but it is very slow, what could be the possible reasons and give the solution for this
Assuming that you are talking about disk space from in the guest OS. You are probably using an MBR partition table, which limits the maximum usable disk space to ~ 2 TB. In order to use the entire disk space, you need a GPT partition table.
André
-
Known problem is there a solution for this?
I get this message when trying to open Photoshop CS4.
Fatal error - component missing
/ Library/Application Support/Adobe/Adobe Version Cue CS4/Client/4.0.0/VersionCue.framework
Is there a solution for this problem? Now CS4 is not usable
Hello
You just need to re - install again.
Here is the link to download the CS4 products: https://helpx.adobe.com/creative-suite/kb/cs4-product-downloads.html
Concerning
Jitendra
-
Can I use external links to my pictures? BC supports this feature? If so, please give me a solution for this.
There is no need to make several posts on this.
First you must understand how the web works. When you visit a website, your computer downloads the images, it's cache, it stores images, load the images and presents them. This is the basic concept.
All Web sites can incorporate an image from another website, including BC.
What you say does not concern if you can hotlink on BC or not... That is until you are actually doing. You mention a CSV file so that you have a web application with custom image and by the CSV field putting external URLS?What is an example of the url you put in? -C' maybe is incorect or in a bad way
What is the configuration of the layout of the web application? -It can not do it in a way to manage the external URL...
There are several things that could be wrong, then you really need to expand on things, please.
-
What is the best solution for this idea...
I have a task I'm trying to test and understand what would be the best solution for this, any recommendations would be appreciated.
Devices at your fingertips:
-2 ESXi hosts
-1 iSCSI SAN OpenFiler (new just installed the app)
2 ESXi hosts run a small amount of virtual machines that are all in the same domain. I want to have a file server (or a repository somewhere) that houses a folder with easily accessible software (OS, Office, etc.) on the field.
According to me, that if I made a virtual machine with a large hard drive and share the software, this would not be the best way because it would be dependent on the OS. Someone has talked about doing a separte VMDK for it and then install it on the operating system on the virtual machine. This way I could always remove the and mount it somewhere else.
It seems a bit weird to me that the software within this "shared folder" will also be sitting on the data store (if I create a virtual machine and need to use the OS/etc). Not that doubles the space for the same software (in the comments, then the data store)?
What is the best approach to make this action which can be accessed at the prompt (mostly windows) in the field?
What is the best way to stay away the software doubles in action and on the data store?
Please forgive me if I put interpereted your question.
The problem you seem to face is that you must mount the ISOs of VMS software and physical systems that are on the field.
(please, correct me if I'm wrong on this)
If this is the case, then the best way to do would be to create sharing NFS on the openfiler, if you use openfiler to main databases also then he would be better for sharing this was separated to prevent the other help to be able to tamper with the VMDK and VMX files for your virtual machines.
This could then be mounted in ESX to access the ISOs. While being easy to install on Linux and Windows machines to access the ISOs.
If you have questions about NFS mounting in windows, so, this link may help
http://sagehacks.WordPress.com/2009/01/21/HOWTO-mount-NFS-shares-under-Windows-7
If you are needing to access the VMs software and it is mainly the downloading ISOs then th ISO directly to the data store is possible.
This allows you to use ESX to mount the ISO on the virtual machine.
On the point that the software will use double disk space when you install the software on a machine virtual car will be on the network share and the VMDK virtual machines in the data store. That's right, and that's by design.
Each virtual machine under ESXI is 'independent' (http://www.vmware.com/virtualization/virtual-machine.html)
This means that each virtual computer must have its own copy of the application.
This perspective reflection of each virtual machine as a separate system of 'physical '. They interact with each other as if they were physical systems.
Each VMDK resembles a physical hard disk. Being accessible (in most configurations) 1 VM at a time.
So if you had a set of physical systems connected to a domain and I wanted to install an application on each one, then each would have its own local copy of the application. It's the same thing with virtual machines.
However
If you configure a set of physical machines so that you run the software from a network share. It is possible to do the same thing using virtual machines using the exactly the same configuration. However, the chiefs more associated to this are important in both cases.
Concerning
Cyclooctane
-
By dictating the long notes on Mac using Siri, Siri will stop as soon as I take a little break. Therefore, the note ends abruptly. Any solution for this?
For long notes, you are better to use regular old dictation - under Mac OS for a few years now, Siri is not mandatory.
To activate it, go to "System Preferences"-> keyboard-> dictation. Once enabled, you can press the "Fn" key twice to activate and dictate the long notes in any application.
Siri is optimized for short, quick things. I don't think that you can change, you just use the method that is better to listen to what you want to do at the time (short notes, using Siri. Long notes, use dictation).
-
I'm having issues get notifications on my iPhone and my Apple Watch. Anyone know of a solution for this?
Difficulty what for? What "issues" are you having?
-
Hello world
How can buy you an IBook of UK not available in Indian store a store; When you change the status of your country, your billing information and credit cards won't work; is there a solution for this using the same method of billing
There is no solution, if it is not available in your area, you can't buy it.
-
I don't know exactly when it happened, but one day my search bar Google turned blue when I tried to kick it. I couldn't see what I was typing. I did some research and some forums that it was a problem with Firefox. Have you heard of this? Is there a solution for this?
Thank you for your help.
Which may be caused by protection of typing"Comcast constant guard.
'Configure the Anti-keylogger settings'-> disable -
I have the latest version of Firefox are installed (which has been updated), but the site says that it is the older. Is there a solution for this problem?
You have a corrupted user agent which identifies you like Firefox/3.0.11
- Mozilla/5.0 (Windows; U; Windows NT 6.1; UK; RV:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 WebMoney Advisor
See:
-
Siri does'nt hear me. Is there any solution for this?
Since installing ios on iPhone 9.2 6 siri does not hear what I'm saying. Is there any solution for this?
Hello Sergeant Hutton,
I understand that Siri doesn't seem to be accepting an entry once activated. Fortunately the steps below can help to restore the full functionality of Siri on your iPhone.
- Make sure that your iOS device has an Internet connection via Wi - Fi or cellular data.
- On your iOS device, make sure that Siri is enabled under settings > general > Siri.
- Restart your iPad, iPhone or iPod touch.
- On your iOS device, go to settings > general > Siri and turn off Siri. Then turn on again.
- Ensure that the microphones on your device are not blocked. For example, if your device has a protection case, remove it.
- If you use an iOS device, try to use Siri with headphones. If the works of Siri, get more help with the microphones on your device.
- Contact Apple support.
Use Siri on your iPhone, iPad or iPod touch
https://support.Apple.com/en-us/HT204389See you soon!
-
I stuck in Outbox of e-mail... .i can receive but can't send out of the Outbox. Does anyone have a solution for this?
have you checked the connection doctor to see if something is wrong with the smtp server
Maybe you are looking for
-
How do you remove live windows messenger invitations that no longer exist?
How can you remove an invitation from windows live messenger when the sender is more lies? I clicked on the icon "No thanks", but it keeps saying "error, the page or the sender could not be found, try again later" & retains the invitation figure. Is
-
Windows 7 drivers for G7-2246nr
Please tell me I can get all the drivers for that laptop SOMEWHERE to make it work with Windows 7! I just bought this thing and I'm going crazy trying to do SANE. I've already uninstalled and partitioned the HARD drive for windows 7 but can't even ge
-
I have a HP Pavilion 4400 series laptop and when I turn it on it shows a black screen and the lights flash and there is a noise of rattling coming from him. What should I do to fix this?
-
Please help me! I have HP Windows Vista Home Basic 32-bit. Cannot open .exe files. I get the error message by side configuration is incorrect. In the event log, it says error in manifest or policy file as a component version required by the applicati
-
Problem installing Hp solution center on win 8.1
Hello support team, I'm updating my OS to win 8.1 I have uninstaaled all the stuff of HP and donnladed OJ_AIO_6500_E709_Full_Win_WW_140_408.exe of your site. When I try to install it again after extraction of the file reaches 100% installation progra