3 Replies - 1257 Views - Last Post: 08 November 2011 - 10:37 AM

#1 liftthis  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 08-May 05

source not found while debugging

Posted 08 November 2011 - 10:16 AM

While I was debugging my debugging stop at BufferFactory.newCharBuffer; It is stating source not found and asking for edit Source Lookup Path.

where would I found this? Is this part of the jdk?

Attached Image

This post has been edited by liftthis: 08 November 2011 - 10:16 AM

Is This A Good Question/Topic? 0
  • +

Replies To: source not found while debugging

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: source not found while debugging

Posted 08 November 2011 - 10:26 AM

I'm betting that's an Android class. The problems will be in classes you wrote, not that come with the Android platform.
Was This Post Helpful? 0
  • +
  • -

#3 liftthis  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 08-May 05

Re: source not found while debugging

Posted 08 November 2011 - 10:36 AM

I was steping into: voice = new Voice(userValue, pswdValue);
This class working on a java gui app I wrote. That's why I believe it has to do with android setup.



package com.cybernetx.android.securetxt;


import java.io.IOException;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.view.View;
import android.view.View.onclickListener;
import android.os.Bundle;
import android.widget.*;
import android.widget.AdapterView.OnItemSelectedListener;
import com.techventus.server.voice.Voice;
import android.provider.ContactsContract;  //fred 11/2/11



public class SmsSend extends Activity implements onclickListener{

	private static final int None = 0;
	private static final int Secret = 1;
	private EditText nbrTxt;
	private EditText msgTxt;
	private EditText keyTxt;
	private Spinner encryptSpinner;
	private Button sndBtn;
	private OnItemSelectedListener encryptionItemListener;
	int encryptSpinnerSelection = 0;

	SmsUtils smsutils = SmsUtils.getSmsUtils();  //call singleton
	Voice voice=null;     

	// fred 11/2/11
	public void onActivityResult(int requestCode, int resultCode, Intent intent) 
	{
		if (requestCode == 10600  && resultCode ==-1)
		{         
			getContactInfo(intent); 
		}
	}


	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.send);

		findViews();
		setAdapters();
		setListeners();
	}

	private void findViews(){
		nbrTxt = (EditText) findViewById(R.id.phonenbr_txt);
		msgTxt = (EditText) findViewById(R.id.message_txt);
		keyTxt = (EditText) findViewById(R.id.key_txt);
		encryptSpinner = (Spinner) findViewById(R.id.from_array);
		sndBtn = (Button)findViewById(R.id.encryptandsend_btn);
	}

	private void setAdapters(){
		ArrayAdapter<CharSequence> adapter = 
			ArrayAdapter.createFromResource(this, R.array.encryptselect, 
					android.R.layout.simple_spinner_item);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		encryptSpinner.setAdapter(adapter);

		encryptSpinner.setSelection(0);
	}

	private void setListeners() {
		// TODO Auto-generated method stub
		encryptionItemListener = new OnItemSelectedListener(){

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {

				switch(arg2){
				case None:
					encryptSpinnerSelection = None;
					break;
				case Secret: 
					encryptSpinnerSelection = Secret;
					break;
				}
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
				// TODO Auto-generated method stub

			}};

			// Fred 11/2/11
			// get contact with long click
			nbrTxt.setOnLongClickListener(new View.OnLongClickListener() {

				public boolean onLongClick(View v) {
					int PICK_CONTACT = 10600;
					Intent intentContact = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); 
					startActivityForResult(intentContact, PICK_CONTACT);
					return false;
				}
			});


			encryptSpinner.setOnItemSelectedListener(encryptionItemListener);

			sndBtn.setonclickListener(this);

			nbrTxt.setonclickListener(this);

			msgTxt.setonclickListener(this);

			keyTxt.setonclickListener(this);




	}

	@Override
	public void onclick(View v) {
		// TODO Auto-generated method stub

		switch(v.getId()){
		case R.id.encryptandsend_btn:
			if((nbrTxt.getText().length() > 0 ) && (msgTxt.getText().length() > 0 ))
			{  
				sendMsg();
			}
			else
			{
				Toast.makeText(getBaseContext(),
						"Please enter both number and message",
						Toast.LENGTH_SHORT).show();
			}

			break;
		}
	}

	
		protected void getContactInfo(Intent intent)
		{	 
			String name;
			String emailAddress;
		    String phoneNumber = "";
		   Cursor cursor =  managedQuery(intent.getData(), null, null, null, null);  
		   while (cursor.moveToNext()) 
		   {           
			   nbrTxt = (EditText) findViewById(R.id.phonenbr_txt);
		       String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
		       name = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME)); 
	
		       String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));
	
		       if ( hasPhone.equalsIgnoreCase("1"))
		           hasPhone = "true";
		       else
		           hasPhone = "false" ;
	
		       if (Boolean.parseBoolean(hasPhone)) 
		       {
		        Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ contactId,null, null);
		        while (phones.moveToNext()) 
		        {
		          phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
		          nbrTxt.setText(phoneNumber);
		        }
		        phones.close();
		       }
	
		       // Find Email Addresses
		       Cursor emails = getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,null,ContactsContract.CommonDataKinds.Email.CONTACT_ID + " = " + contactId,null, null);
		       while (emails.moveToNext()) 
		       {
		        emailAddress = emails.getString(emails.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));
		       }
		       emails.close();
	
		  }  //while (cursor.moveToNext())        
		   cursor.close();
		}//getContactInfo





	public void sendMsg(){

		
		String userValue =  smsutils.getUserId();
		String pswdValue =  smsutils.getUserPassword();
		String nbrValue  =  nbrTxt.getText().toString();
		String msgValue  =  msgTxt.getText().toString();
		//Toast.makeText(this, "Message Sent", Toast.LENGTH_LONG).show();
		//Toast.makeText(this, userValue, Toast.LENGTH_LONG).show();
		//Toast.makeText(this, pswdValue, Toast.LENGTH_LONG).show();
		//Toast.makeText(this, nbrValue , Toast.LENGTH_LONG).show();
		//Toast.makeText(this, msgValue, Toast.LENGTH_LONG).show();

		 if (userValue.indexOf("@") > 0)
	     {
	            try 
	            {
	            	Toast.makeText(this, userValue, Toast.LENGTH_LONG).show();
					voice = new Voice(userValue, pswdValue);
				} 
	            catch (Exception e) 
	            {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			 
	     } 
		 else
	     {
	            String s2 = String.valueOf(userValue);
	            String s3 = (new StringBuilder(s2)).append("@gmail.com").toString();
	            try 
	            {
	            	Toast.makeText(this, s3, Toast.LENGTH_LONG).show();
					voice = new Voice(s3, pswdValue);
				} 
	            catch (Exception e) 
	            {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	           
	     }


		try 
		{
		    Toast.makeText(this, "Message Sent", Toast.LENGTH_LONG).show();
			voice.sendSMS(nbrValue,msgValue);		
			this.finish();
		} 
		catch (Exception e) 
		{
			Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT);
		}
		

	}
}



Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: source not found while debugging

Posted 08 November 2011 - 10:37 AM

What specific Exceptions are you encountering? What does your LogCat say? Also, make sure to Log your Exceptions so you can trace them on the LogCat.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1