Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
rakeshmjiyani
Posts: 66
Registered: ‎08-28-2010
My Device: 9630

Location Service disable

Hi,

 

     I am developing application regarding the Location servcie. My application will support OS >5.0 .

 

 I am facing two problem while developing my application and my problem is as below.

 

 problem 1 > i want get the notification event in my application if any user manually disable or enable the location service. can i know if any method available in blackberry so i can get the event whenever location service is enable 

or disable.

 

 problem 2> i want display the notification into my application. i am able to get the notification using the below code.

 

{
		
		ApplicationMessageFolder folder = null;
        ApplicationMessageFolderRegistry reg = ApplicationMessageFolderRegistry.getInstance();
		try
		{
			Alert.startVibrate(1000);
			/*javax.microedition.lcdui.Alert a = new javax.microedition.lcdui.Alert();
			a.*/
			/*ApplicationMessageFolder folder = null;
			
			try
			{*/
			if(ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL)==null)
	        {
					folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(0x33c7ce29883abe5fL, "Test Folder", new ReadableListImpl());
	        }
	        else
	        {
	        	folder = ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL);
	        }
				/*ApplicationMessageFolder folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(
					0x33c7ce29883abe5fL, "SecuRemote", new ReadableListImpl());*/
			/*}
			catch (Exception e) 
			{
				
			}*/
			//DemoMessage source is available in the messagelistdemo.
			DemoMessage msg = new DemoMessage("SecuRemote", "Region Monitoring",message, System.currentTimeMillis());
			folder.fireElementAdded(msg);
			
			//folder.fireReset();
	
			//Display the application indicator icon.
			/*ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();    
	
			EncodedImage image = EncodedImage.getEncodedImageResource("indicator.png");
	
			ApplicationIcon icon = new ApplicationIcon(image);
	
			ApplicationIndicator indicator = reg.register(icon, false, true);
			indicator.setIcon(icon);
			indicator.setVisible(true);*/
		}

 

 But the problem is i can only display message with limited lenght of message. i want display message with long

string may be more than 160 character.

 

 Can anybody help to resolve my 2 problem as i want release my application to market soon.

 

 

Regards,

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Location Service disable

"1.i want get the notification event in my application if any user manually disable or enable the location service."

 

I ma not aware of a way of doing this.  The best that I think you can do is try to use the service and see if it has been enabled or not. 

 

Sorry, I can't help with your notification issue.  Not an area of expertise. 

 

 

Regular Contributor
rakeshmjiyani
Posts: 66
Registered: ‎08-28-2010
My Device: 9630

Re: Location Service disable

Hi,

Peter

 

    thanks for reply. as you have suggest me the below response for my problem no 1.

 

   "I ma not aware of a way of doing this.  The best that I think you can do is try to use the service and see if it has been enabled or not.1 "

 

  can you provide me sample code so i get idea for that service is enabled or not. as i think this is available in OS 6.0 but my base application is on OS 5.0.

 

 can you suggest me where could i find soultion for my problem 2.

 

Regards,

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Location Service disable

Sample code:

http://supportforums.blackberry.com/t5/Java-Development/Location-APIs-Start-to-finish/ta-p/571949

 

https://github.com/blackberry/Samples-for-Java/tree/master/Simple%20Location%20API

 

Re notifications, I would suggest you start a new Thread with just this question, making sure you give it a "Subject" that reflects this, as there are other contributors to this forum who can help with Notifications but are perhaps not so knowledgeable in Location and so will be put off by your current subject.