02-23-2012 09:00 AM
Hi ,
I am using push in my application,and i use push Library which is library project,not the SDk,When i receive the some msg,i should update the icon,
So when i try to change the icon from the pushlibrary using
HomeScreen.updateIcon(bitmap, 1);
It is not getting updated,and i am not getting any error.
Is there any issue related to alternate entry point,I also set the icon for the alternate entry point,But i am not able to get the icon updated,
Any help from your side wll be useful.
Thanks
Rakesh shankar.P
02-23-2012 09:11 AM
02-24-2012 12:41 AM
HI simon,
I tried giving homeScreen.updateIcon(bitamp,0) in push library classs,i am not getting any icon updated.I am having only one alternate entry point,I thought specifying homeScreen.updateIcon(bitamp,1) will work,
But i am trying to update by sending the global event.
Regards
Rakesh Shankar.P
02-24-2012 11:27 PM
Try using this code to get the correct entry point. I've had issues with using the correct number in the past, but have never had any problems doing it this way.
int id = 0;
id = CodeModuleManager.getModuleHandle("NameOfMyEntryPo int");
ApplicationDescriptor [] appDesc = CodeModuleManager.getApplicationDescriptors(id);
ApplicationDescriptor descrip = appDesc[0];
HomeScreen.updateIcon(icon, descrip);
03-02-2012 12:50 AM
Hi,I have tried as you said CMY,But i am not able to get the processId for the alternate entry point,Alternate entry point is not there.
I want to whether alternate entry point will be there in list of applications all the time? or Will it be available at the the time of the pushing of data.
But in both cases i am not able to get the alternate the entry point?
One more thing,should the homescreen position should be 1 while doing this case?
Regards
Rakesh Shankar.P
03-02-2012 04:18 AM
I have not been able to update icons for things in the past too. I've even tried the App Descriptor approach suggested by CMY I think and it didn't work. I have also found that some things work in OS 6.0 that don't work in OS 5.0 to do with being able to change the icon.
The only time I can be sure that I will be able to change an icon is if I do it for a running Application.
Now I am not saying this is the only way, just I have fought the system trying to change it and this is the only scenario in which I have been able to consistently change it.
I have some ideas on how you can get round this restriction, but to explain, I would need to understand your exact situation with respect to Applications you start and the use of main(). Can you describe, your Alternate Entry points, how many icons you have, what they do, and what the users sees on the Task Switcher (the icon that appears on Task Switcher seems to have a mind of its own too).
03-02-2012 10:47 AM
Hi Simon,
I tried as you said.Icon updating is not constant.Icon gets updated some times,
When i am pushing the message,icon should get updated with the unread icon.the icon gets updated some times.
Similarly once the app is launched, icon should be updated to read icon,but the unread icon remains there even after openning the app.
if (args != null && args.length > 0) {
home = new MyApp(Constants.url + getPushParams());
home.addGlobalEventListener(home);
if (args[0].equals("init")) { // “init” argument passed in build.xml
System.out.println("WithinInit");
home.pushScreen(new SplashScreen(home, null));
} else {
System.out.println("NotInit");
String pushUrl = args[0];
Constants.alertTabFocus = true;
if (pushUrl != null && pushUrl.startsWith("http://")) {
home.pushScreen(new SplashScreen(home, pushUrl));
}
}
HomeScreen.updateIcon(pushConfig.getReadIcon(), 1);
ApplicationManager.getApplicationManager().postGlo balEvent(xxxxxxxxx, 0, 0, null, Constants.pushDataVector);
home.enterEventDispatcher();
}else{
MyPushApplication application = new MyPushApplication(pushConfig);
application.startPushListener(Constants.pushDataVe ctor);
application.addGlobalEventListener(application);
application.enterEventDispatcher();
}
For the Other apps we used build.xml we did not gave any alternate point settings in project properties ,and all was done in ant build with old eclipse format which does not app descriptor.xml file and it worked .
But in new eclipse,I am giving alternate entry point ,and i am not displaying any alternate entry point in home screen.above code will let you know it.
Regards
Rakesh Shankar.P
03-02-2012 12:44 PM
OK, this is not quite what I was expecting.
To confirm, you have 2 alternate entries for this application. One has the string "init", one has something else and the standard entry has nothing and this is the one you have marked for auto start.
Given this, I would expect the two entries that have start up parameters to have icons associated and these entries would be started by the user.
If we just focus on converting the unread to the read icon, it is all down to this statement:
HomeScreen.updateIcon(pushConfig.getReadIcon(), 1);
Now this is going to attempt to change the icon of one of the entries, but which one?
If you change this to:
HomeScreen.updateIcon(pushConfig.getReadIcon());
it will update the running application, i.e. one of the icons for "init" or other startup parameter. Give this a try and see what happens.
03-05-2012 09:33 AM - edited 03-05-2012 09:44 AM
Hi Peter,Thanks for your inputs.
I am having single alternate entry point when args in not init,thats time when push params are executed.Init is the main entry point,In the app.descriptor.xml i am using application arguments as init in my application.So when the app launches ,it goes thr init.
As you said,I tried using HomeScreen.updateIcon(pushConfig.getReadIcon());
It worked in case,When the application is in background,
So When the application is not opened,I am not able to reach the event occured of my app.I am checking that case.So how can i achieve that.
Thanks
Rakesh Shankar.P
03-05-2012 10:56 AM
"I am having single alternate entry point "
Your code suggests otherwise. If you look at your main() there are three possible startups
a) No parm
b) parm == "init"
b) Param != "init"
Something for you to tidyup?
IN answer to your question, as noted
"The only time I can be sure that I will be able to change an icon is if I do it for a running Application."
So if your "init" startup is not running, I'm not sure how to update its icon.
I would try creating and App Descriptor with the "init" startup parameter and see if that works. Or try the index method. If that doesn't work, come back and hopefully some one else can help. Otherwise you are in for hokey methods involving starting the app.