blackberry

Blackberry ListField: Maintaining row focus during an update

雨燕双飞 提交于 2019-12-13 06:02:00
问题 After using the code below to refresh a ListField containing data returned in an xml web service. But after refresh or on refresh it sets focus to the first row in the ListField. I don't want that. I want it to maintain its current focus after refresh so that a user wont even know that there was a refresh. protected void onUiEngineAttached(boolean attached) { if (attached) { // TODO: you might want to show some sort of animated // progress UI here, so the user knows you are fetching data

Check if BlackBerry gps is enabled

北城余情 提交于 2019-12-13 05:45:15
问题 I am developing an app in which I have to check programmatically if gps is enabled or not for locations in phone? How do I find this? 回答1: if (!LocationInfo.isLocationOn()) { try { LocationInfo.setLocationOn(); } catch (ControlledAccessException cae) { // You don't have the rights to enable GPS programatically. // You might want to prompt the user for it. } } You might also want to have a look at the following functions: LocationInfo.isLocationSourceAvailable(int mode) - Determines if a

Store XML, update record in XML, retrieve a specific record in XML stored on BB device

孤者浪人 提交于 2019-12-13 05:35:28
问题 I am writing a blackberry application where I want to store the data returned by a web service in my BB device. Earlier I was going to use SQLite for storing the data in mobile but as I googled and also did programming using SQLite and found that some BB devices don't support SQLite library and fail to create the database. Then I decided to keep the data returned by webservice in a XML format on my BB device. I just want to know is there any method or way in blackberry through which i can

How to download an html file in a BlackBerry application

六眼飞鱼酱① 提交于 2019-12-13 05:13:44
问题 I need to scrape information from a web page and put it into my application, but I can't figure out how to download the file into my application in the first place. Anyone have any ideas? 回答1: You can use my simple page scraping code. You'll also want to use Versatile Monkey's networking helper class to open the HTTP connection using the best path on a BlackBerry. 来源: https://stackoverflow.com/questions/5007127/how-to-download-an-html-file-in-a-blackberry-application

Blackberry ApplicationIndicator click handler on Home Screen

こ雲淡風輕ζ 提交于 2019-12-13 05:00:01
问题 I am creating an application which has a notification icon on the status bar of the BlackBerry home screen. I want to launch my app when this notification icon is clicked. I am able to create a notification icon in the status bar with ApplicationIndicator, but I am not able to register a click handler to launch the application. 回答1: In Blackberry OS 6.0 we have a new API which can be used for launching an app from the notification bar. Here is an example: try { DemoMessage msg = new

Refreshing Table Model Adapter on deleting record from it : Blackberry

∥☆過路亽.° 提交于 2019-12-13 04:42:15
问题 I m creating a Table Model Adapter in Blackberry.( ** This is a sample what i m doing ****)I have added button field and two Strings.I m putting data in String from vector.Now on button click i want to delete the row against button.The Data is deleted from the database but not removed from Screen view when button is clicked.When i calld the Retrieve() function to call updated database and draw the Table model adapter again....it is adding new Table below old one....not refreshing it. Is there

In Listfield not able to view the fields in blackberry

我怕爱的太早我们不能终老 提交于 2019-12-13 04:40:52
问题 i have tried this link How to customize a ListField in BlackBerry? to create the ListField with Three lablefields for every list row.but iam not able see the list field items.but i can say that listfield is added.because on navigation click i am able get the selected index of the listfield.please anybody help where iam doing mistake.The code i have tried is... public class InboxWithOutCheckboxeslistfield extends ListField implements ListFieldCallback { private Vector rows; private

Which build to be considered for use when a preprocessor is used

帅比萌擦擦* 提交于 2019-12-13 04:40:51
问题 I have a project which needs to be used in 4.6 and 5.0 versions of blackberry. I have run same code in both the 4.6 and 5.0 versions with some preprocessor directives attached to the code (#ifndef statements which i need to use for 5.0 as facebook sdk is not supported in 4.6 version) I have 2 .cod files ( one for 4.6 and other for 5.0) they work as needed in their respective simulators. But, when i load the .cod file of 4.6 into 5.0 ... (it treats it as the code inside preprocessor as comment

BlackBerry - Show typing mode indicator programmatically

最后都变了- 提交于 2019-12-13 04:23:58
问题 Do you know some way to programmaticaly show different typing indicators on the screen? I know I can simply draw bitmap but I'd like to do it universally for any RIM OS version. Also, there is a setMode(int) function in 4.2.1 but in 4.3 it's already deprecated... Any suggestions will be helpful, thanks! 回答1: since there is no alternatives, I made a sample with provided images: alt text http://img42.imageshack.us/img42/6692/typeindicator.jpg alt text http://img3.imageshack.us/img3/5259

Downloading large file over HttpConnection

≯℡__Kan透↙ 提交于 2019-12-13 03:59:35
问题 Using the following code i can load any file from url as a bytes but this way works fine for file not larger than 256kb . So I want another way to load larger files as bytes without using BlackBerry Combiner my code : HttpConnection hpc = null; try { hpc = (HttpConnection) Connector.open(url + ConnectionManager.getTimeOut(5000) + ConnectionManager.updateConnectionSuffix()); hpc.setRequestMethod(HttpConnection.GET); hpc.setRequestProperty("Connection", "Keep-Alive"); if (hpc.getResponseCode()