Problems with executing 'substring':

by Prabakar » Sun, 21 Feb 2010 21:20:01 GMT


Sponsored Links
 Hello,

I am wondering whether 'substring' support is there or not on Android 1.1 
minimum SDK set in Eclipse project. Actually i installed Android 1.6 SDK.
I use the following parse function, where-in i use 'substring' for few places. 
I am not getting any result from the 'substring' code and it jumps to 
Timer.class file to show 'The JAR of this class file belongs to 'Android 1.1 
which does not allow modifications to source attachments on its entities' etc. 
message, when debugging 'substring' line of code. 
I don't know why it is not executing 'substring' line of code in my below 
function and jumps to show such message like that to me?
Note: This function is under Timer running code.

private String parseContentsString(String inputDataStr)
 {
 String parsedOutput = null;
 int i = 0;
 int nameIndEnd = 0;
 int startIndex = 0;
 int endIndex = 0;
 
 i = inputDataStr.indexOf("TickerTxt>");
 if (i != -1)
 {
 nameIndEnd = inputDataStr.indexOf("", i);
 if (nameIndEnd > 0)
 {
 startIndex = i + 10;
 endIndex = nameIndEnd - startIndex;
 parsedOutput += " ";
 parsedOutput = inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }
 }
 while ((i = inputDataStr.indexOf("name=", i)) != -1)
 {
 nameIndEnd = inputDataStr.indexOf("target=", i);
 startIndex = i + 5;
 endIndex = (nameIndEnd - 2) - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }
 i = inputDataStr.indexOf("<B>", i);
 startIndex = i + 3;
 nameIndEnd = inputDataStr.indexOf("</B>", i);
 endIndex = nameIndEnd - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 } 
 i = inputDataStr.indexOf("font color=", i);
 i = inputDataStr.indexOf(">", i);
 startIndex = i + 1;
 nameIndEnd = inputDataStr.indexOf("", i);
 endIndex = nameIndEnd - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }  
 i = inputDataStr.indexOf("", i);
 startIndex = i + 12;
 nameIndEnd = inputDataStr.indexOf("%]", i);
 endIndex = (nameIndEnd + 2) - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ; ";
 }
 i++;
 }
 return parsedOutput;
 }
 
Could someone help me on get rid of this problem and to execute 'substring' 
successfully?


Martin.



      

--



Problems with executing 'substring':

by Prabakar » Mon, 22 Feb 2010 02:39:56 GMT


 UPDATED: I tried putting this code in onCreate place itself directly instead of 
under Timer code as i said earlier, and found that it throws message as "source 
not found - ThreadGroup.class file" when crossing 'substring' line of code. 




From: Prabakar <prabhu_mp...@yahoo.com>
Subject: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Sunday, February 21, 2010, 6:49 PM

Hello,

I am wondering whether 'substring' support is there or not on Android 1.1 
minimum SDK set in Eclipse project. Actually i installed Android 1.6 SDK.
I use the following parse function, where-in i use 'substring' for few places. 
I am not getting any result from the 'substring' code and it jumps to 
Timer.class file to show 'The JAR of this class file belongs to 'Android 1.1 
which does not allow modifications to source attachments on its entities' etc. 
message, when debugging 'substring' line of code. 
I don't know why it is not executing 'substring' line of code in my below 
function and jumps to show such message like that to me?
Note: This function is under Timer running code.

private String parseContentsString(String inputDataStr)
 {
 String
 parsedOutput = null;
 int i = 0;
 int nameIndEnd = 0;
 int startIndex = 0;
 int endIndex = 0;
 
 i = inputDataStr.indexOf("TickerTxt>");
 if (i != -1)
 {
 nameIndEnd = inputDataStr.indexOf("", i);
 if (nameIndEnd > 0)
 {
 startIndex = i +
 10;
 endIndex = nameIndEnd - startIndex;
 parsedOutput += " ";
 parsedOutput = inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }
 }
 while ((i = inputDataStr.indexOf("name=", i)) != -1)
 {
 nameIndEnd = inputDataStr.indexOf("target=",
 i);
 startIndex = i + 5;
 endIndex = (nameIndEnd - 2) - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }
 i = inputDataStr.indexOf("<B>", i);
 startIndex = i +
 3;
 nameIndEnd = inputDataStr.indexOf("</B>", i);
 endIndex = nameIndEnd - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 } 
 i = inputDataStr.indexOf("font color=",
 i);
 i = inputDataStr.indexOf(">", i);
 startIndex = i + 1;
 nameIndEnd = inputDataStr.indexOf("", i);
 endIndex = nameIndEnd - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ";
 }
  
 i = inputDataStr.indexOf("", i);
 startIndex = i + 12;
 nameIndEnd = inputDataStr.indexOf("%]", i);
 endIndex = (nameIndEnd + 2) - startIndex;
 if (i > 0 && nameIndEnd > 0)
 {
 parsedOutput += inputDataStr.substring(startIndex, endIndex);
 parsedOutput += " ;
 ";
 }
 i++;
 }
 return parsedOutput;
 }
 
Could someone help me on get rid of this problem and to execute 'substring' 
successfully?


Martin.





      



--


Sponsored Links


Problems with executing 'substring':

by Prabakar » Mon, 22 Feb 2010 04:25:51 GMT


  could able to resolve 'source not found' problem after following the steps 
mentioned in the following link:
http://android.opensourceror.org/2010/01/18/android-source/

But still 'substring' doesn't work. It does nothing there seems to be, don't
know why?

--- On Mon, 2/22/10, Prabakar <prabhu_mp...@yahoo.com> wrote:

From: Prabakar <prabhu_mp...@yahoo.com>
Subject: Re: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Monday, February 22, 2010, 12:09 AM

UPDATED: I tried putting this code in onCreate place itself directly instead of
under Timer code as i said earlier, and found that it throws message as "source
not found - ThreadGroup.class file" when crossing 'substring' line of code.

--- On Sun, 2/21/10, Prabakar <prabhu_mp...@yahoo.com> wrote:

From: Prabakar <prabhu_mp...@yahoo.com>
Subject: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Sunday, February 21, 2010, 6:49 PM

Hello,

I am wondering whether 'substring' support is there or not on Android 1.1
minimum SDK set in Eclipse project. Actually i installed Android 1.6 SDK.
I use the following parse function, where-in i use 'substring' for few places.
I am not getting any result from the 'substring' code and it jumps to
Timer.class file to show 'The JAR of this class file belongs to 'Android 1.1
which does not allow modifications to source attachments on its entities' etc.
message, when debugging 'substring' line of code.
I don't know why it is not executing 'substring' line of code in my below
function and jumps to show such message like that to me?
Note: This function is under Timer running code.

private String parseContentsString(String inputDataStr)
{
String
parsedOutput = null;
int i = 0;
int nameIndEnd = 0;
int startIndex = 0;
int endIndex = 0;

i = inputDataStr.indexOf("TickerTxt>");
if (i != -1)
{
nameIndEnd = inputDataStr.indexOf("", i);
if (nameIndEnd > 0)
{
startIndex = i +
10;
endIndex = nameIndEnd - startIndex;
parsedOutput += " ";
parsedOutput = inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
}
while ((i = inputDataStr.indexOf("name=", i)) != -1)
{
nameIndEnd = inputDataStr.indexOf("target=",
i);
startIndex = i + 5;
endIndex = (nameIndEnd - 2) - startIndex;
if (i > 0 && nameIndEnd > 0)
{
parsedOutput += inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
i = inputDataStr.indexOf("<B>", i);
startIndex = i +
3;
nameIndEnd = inputDataStr.indexOf("</B>", i);
endIndex = nameIndEnd - startIndex;
if (i > 0 && nameIndEnd > 0)
{
parsedOutput += inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
i = inputDataStr.indexOf("font color=",
i);
i = inputDataStr.indexOf(">", i);
startIndex = i + 1;
nameIndEnd = inputDataStr.indexOf("", i);
endIndex = nameIndEnd - startIndex;
if (i > 0 && nameIndEnd > 0)
{
parsedOutput += inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}

i = inputDataStr.indexOf("", i);
startIndex = i + 12;
nameIndEnd = inputDataStr.indexOf("%]", i);
endIndex = (nam



Problems with executing 'substring':

by Prabakar » Mon, 22 Feb 2010 20:04:33 GMT


  resolved substring problem. It was my mistake that 'substring' 'endoffset' 
value was wrong.
"substring(startIndex, endIndex);"

Martin.

--- On Mon, 2/22/10, Prabakar <prabhu_mp...@yahoo.com> wrote:

From: Prabakar <prabhu_mp...@yahoo.com>
Subject: Re: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Monday, February 22, 2010, 1:55 AM

I could able to resolve 'source not found' problem after following the steps
mentioned in the following link:
http://android.opensourceror.org/2010/01/18/android-source/

But still 'substring' doesn't work. It does nothing there seems to be, don't
know why?

--- On Mon, 2/22/10, Prabakar <prabhu_mp...@yahoo.com> wrote:

From: Prabakar <prabhu_mp...@yahoo.com>
Subject: Re: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Monday, February 22, 2010, 12:09 AM

UPDATED: I tried putting this code in onCreate place itself directly instead of
under Timer code as i said earlier, and found that it throws message as "source
not found - ThreadGroup.class file" when crossing 'substring' line of code.

--- On Sun, 2/21/10, Prabakar <prabhu_mp...@yahoo.com> wrote:

From: Prabakar <prabhu_mp...@yahoo.com>
Subject: [android-beginners] Problems with executing 'substring':
To: android-beginners@googlegroups.com
Date: Sunday, February 21, 2010, 6:49 PM

Hello,

I am wondering whether 'substring' support is there or not on Android 1.1
minimum SDK set in Eclipse project. Actually i installed Android 1.6 SDK.
I use the following parse function, where-in i use 'substring' for few places.
I am not getting any result from the 'substring' code and it jumps to
Timer.class file to show 'The JAR of this class file belongs to 'Android 1.1
which does not allow modifications to source attachments on its entities' etc.
message, when debugging 'substring' line of code.
I don't know why it is not executing 'substring' line of code in my below
function and jumps to show such message like that to me?
Note: This function is under Timer running code.

private String parseContentsString(String inputDataStr)
{
String
parsedOutput = null;
int i = 0;
int nameIndEnd = 0;
int startIndex = 0;
int endIndex = 0;

i = inputDataStr.indexOf("TickerTxt>");
if (i != -1)
{
nameIndEnd = inputDataStr.indexOf("", i);
if (nameIndEnd > 0)
{
startIndex = i +
10;
endIndex = nameIndEnd - startIndex;
parsedOutput += " ";
parsedOutput = inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
}
while ((i = inputDataStr.indexOf("name=", i)) != -1)
{
nameIndEnd = inputDataStr.indexOf("target=",
i);
startIndex = i + 5;
endIndex = (nameIndEnd - 2) - startIndex;
if (i > 0 && nameIndEnd > 0)
{
parsedOutput += inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
i = inputDataStr.indexOf("<B>", i);
startIndex = i +
3;
nameIndEnd = inputDataStr.indexOf("</B>", i);
endIndex = nameIndEnd - startIndex;
if (i > 0 && nameIndEnd > 0)
{
parsedOutput += inputDataStr.substring(startIndex, endIndex);
parsedOutput += " ";
}
i = inputDataStr.indexOf("font color=",
i);
i = inputDataStr.indexOf(&q



Other Threads

1. will maps application work on sdk 1.5 supported devices?

Hi,

can any one please explain in detail why 1.5, 1.5G emulators are
given?

Can't the maps applications work on 1.5 emulator/supported devices ?

The added advantage of 1.5G emulator is for running the maps kind of
applications. Is it true?

And are there any two separate devices available for 1.5 and 1.5G?

Can any one please explain me in detail about the above queries.

Help would be appreciated.

Thanks,
Manoj.
--~--~---------~--~----~------------~-------~--~----~

2. VERY URGENT : The app not working fine on 1.5G emulator (target name: Google APIs) which is working fine on 1.0 emulator

Hi I have written a location based app.

The app finds a route between two coordinates. Its working fine on 1.0
emulator as well as on 1.0 supported devices.

Now I tried to run the same app on 1.5G (Google APIs ) emulator. Its
not working. It is not showing the route. and got the following log
messages:

D/GpsLocationProvider(  568): setMinTime 0
I/Maps.MyLocationOverlay(  655): Request updates from gps
E/LocationManagerService(  568): isProviderEnabled got exception:
E/LocationManagerService(  568): java.lang.IllegalArgumentException:
provider=network
E/LocationManagerService(  568):        at
com.android.server.LocationManagerService._isProviderEnabledLocked
(LocationManagerService.java:1514)
E/LocationManagerService(  568):        at
com.android.server.LocationManagerService.isProviderEnabled
(LocationManagerService.java:1499)
E/LocationManagerService(  568):        at android.location.ILocationManager
$Stub.onTransact(ILocationManager.java:245)
E/LocationManagerService(  568):        at android.os.Binder.execTransact
(Binder.java:287)
E/LocationManagerService(  568):        at dalvik.system.NativeStart.run
(Native Method)


and I tested the maps app on 1.5G emulator. When I tried to get my
current location,
I got the alert "Your location cannot be determined. We will keep
trying, but you can also try moving your position".

and the log says:
D/GpsLocationProvider(  568): setMinTime 0
I/Maps.MyLocationOverlay(  655): Request updates from gps
E/LocationManagerService(  568): isProviderEnabled got exception:
E/LocationManagerService(  568): java.lang.IllegalArgumentException:
provider=network
E/LocationManagerService(  568):        at
com.android.server.LocationManagerService._isProviderEnabledLocked
(LocationManagerService.java:1514)
E/LocationManagerService(  568):        at
com.android.server.LocationManagerService.isProviderEnabled
(LocationManagerService.java:1499)
E/LocationManagerService(  568):        at android.location.ILocationManager
$Stub.onTransact(ILocationManager.java:245)
E/LocationManagerService(  568):        at android.os.Binder.execTransact
(Binder.java:287)
E/LocationManagerService(  568):        at
com.android.server.SystemServer.init1(Native Method)
E/LocationManagerService(  568):        at
com.android.server.SystemServer.main(SystemServer.java:412)
E/LocationManagerService(  568):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/LocationManagerService(  568):        at java.lang.reflect.Method.invoke
(Method.java:521)
E/LocationManagerService(  568):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/LocationManagerService(  568):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/LocationManagerService(  568):        at dalvik.system.NativeStart.main
(Native Method)
W/I


I am not understanding why I am not getting the current location.

Can any one please help me to solve this problem?

Thanks,
Manoj.
--~--~---------~--~----~------------~-------~--~----~

3. how to get focus window in inputmethod's view

4. Procedure to send dbus messages through command line

5. How to redirect audio to bluetooth headset?

6. Is there any doc exist for porting android 1.5 into x86

7. Emulator is not coming up if we will do the changes in CUPCAKE version