Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Source not found(the source attachment does not contain the source for the file)
Source not found [message #725892] Fri, 16 September 2011 06:01 Go to next message
Prasad  is currently offline Prasad Friend
Messages: 4
Registered: September 2011
Junior Member
Hello,

I am newbie to Eclipse. I am working on Android and Eclipse on the linux ubuntu platform.

I am trying to write a program for Server-Client socket communication.
Below is the code snippet:

try{
Log.d(LOG_TAG, "OK");
providerSocket = new ServerSocket(8000, 10);
connection = providerSocket.accept();

boolean a = connection.isConnected();

Toast.makeText(this, "Connection established!",
Toast.LENGTH_LONG).show();
return;
}
catch(IOException e)
{
Log.v(LOG_TAG, "NOK");
e.printStackTrace();
}

When i debug the code, it reaches at connection = providerSocket.accept(); and stops debugger by showing below message
Source Not found
The source attachment does not contain the source file ServerSocket.class
You can change the source attachment by clicking Change Attached Source below:

When i try to click on button i dont find any source file src.zip in the directory of Android.
Eclipse does have src.zip but in many folders so i am confused to choose which file to be selected.

Any other clues??

Prasad
Re: Source not found [message #725907 is a reply to message #725892] Fri, 16 September 2011 06:57 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 16.09.2011 08:01, Prasad wrote:
> Hello,
>
> I am newbie to Eclipse. I am working on Android and Eclipse on the
> linux ubuntu platform.
>
> I am trying to write a program for Server-Client socket communication.
> Below is the code snippet:
>
> try{
> Log.d(LOG_TAG, "OK");
> providerSocket = new ServerSocket(8000, 10);
> connection = providerSocket.accept();
> boolean a = connection.isConnected();
> Toast.makeText(this, "Connection
> established!",
> Toast.LENGTH_LONG).show();
> return;
> }
> catch(IOException e) {
> Log.v(LOG_TAG, "NOK");
> e.printStackTrace();
> }
>
> When i debug the code, it reaches at connection =
> providerSocket.accept(); and stops debugger by showing below message
> Source Not found
> The source attachment does not contain the source file ServerSocket.class
> You can change the source attachment by clicking Change Attached
> Source below:
>
> When i try to click on button i dont find any source file src.zip in
> the directory of Android. Eclipse does have src.zip but in many
> folders so i am confused to choose which file to be selected.
>
> Any other clues??
You first need to figure out from which library that code comes and then
get the source for it.

Dani
>
> Prasad
Re: Source not found [message #725922 is a reply to message #725907] Fri, 16 September 2011 07:44 Go to previous messageGo to next message
Prasad  is currently offline Prasad Friend
Messages: 4
Registered: September 2011
Junior Member
It is packed in the android.jar file.
I think java and android libraries are bundled in the same .jar file.

I even tried to reassigning path to android.jar file but still not working

[Updated on: Fri, 16 September 2011 07:45]

Report message to a moderator

Re: Source not found [message #725947 is a reply to message #725922] Fri, 16 September 2011 09:01 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 16.09.2011 09:44, Prasad wrote:
> It is packed in the android.jar file.
> I think java and android libraries are bundled in the same .jar file.
No. Java comes from Oracle in is in the Java JRE (or better SDK if you
want the source too). Android comes from Google and hence you need to go
there to get the sources. I would expect that the Android source comes
along with the Android SDK.

Dani
Re: Source not found [message #725998 is a reply to message #725947] Fri, 16 September 2011 11:32 Go to previous messageGo to next message
Prasad  is currently offline Prasad Friend
Messages: 4
Registered: September 2011
Junior Member
I am basically not able to understand is this a problem of Android or Eclipse?
Other Android code is working fine. Only perticular statements create problem.
Re: Source not found [message #726010 is a reply to message #725998] Fri, 16 September 2011 11:47 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 16.09.2011 13:32, Prasad wrote:
> I am basically not able to understand is this a problem of Android or
> Eclipse?
> Other Android code is working fine. Only perticular statements create
> problem.
If the class is from Android then it is an Android problem.

Dani
Re: Source not found [message #726085 is a reply to message #725998] Fri, 16 September 2011 14:12 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 16-Sep-11 05:32, Prasad wrote:
> I am basically not able to understand is this a problem of Android or
> Eclipse?
> Other Android code is working fine. Only perticular statements create
> problem.

Prasad, there are good Android forums:
http://www.javahotchocolate.com/tutorials/android.html#support
Re: Source not found [message #726141 is a reply to message #726085] Fri, 16 September 2011 16:31 Go to previous messageGo to next message
Prasad  is currently offline Prasad Friend
Messages: 4
Registered: September 2011
Junior Member
Thanks!
Hope it solves my problem.
Re: Source not found [message #727188 is a reply to message #725922] Tue, 20 September 2011 15:18 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 9/16/11 3:44 AM, Prasad wrote:
> It is packed in the android.jar file.
> I think java and android libraries are bundled in the same .jar file.
>
>

Install the Android Sources plugin and you'll be able to view much of
the code for android.jar classes: http://code.google.com/p/adt-addons/
(scroll down to the section "Android Sources."

Eric
Previous Topic:indexer search path
Next Topic:alt + shift + down arrow equivalent
Goto Forum:
  


Current Time: Tue Mar 19 04:31:59 GMT 2024

Powered by FUDForum. Page generated in 0.03796 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top