[android-developers]regarding bluetooth auto-pairing urgernt

2013-04-06 Thread akash roy
can anyone tell me is auto pairing possible using bluetooth android i mean
to say no user interrupt is required.

*
*

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-15 Thread akash roy
@Indicator Veritatis

code for mminstream that u r asking for. :

private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
private final OutputStream mmOutStream;

public ConnectedThread(BluetoothSocket socket) {
Log.d(TAG, create ConnectedThread);
mmSocket = socket;
InputStream tmpIn = null;
OutputStream tmpOut = null;

// Get the BluetoothSocket input and output streams
try {
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) {
Log.e(TAG, temp sockets not created, e);
}

mmInStream = tmpIn;
mmOutStream = tmpOut;
}

public void run() {
Log.i(TAG, BEGIN mConnectedThread);
byte[] buffer = new byte[4096];
int bytes = 0,mb;
String file_name;
long file_length;

// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
Log.d(TAG, file creating);
FileOutputStream fos = new
FileOutputStream(sdcard/abc.txt);
BufferedOutputStream bos = new BufferedOutputStream(fos);
/*BufferedReader nbr=new  BufferedReader(new
InputStreamReader(mmInStream));
file_name=nbr.readLine();
Log.d(TAG, file_name);
file_length= Long.parseLong(nbr.readLine());
Log.d(TAG, file length withdrawn);
double nosofpackets = Math.ceil(( (int)file_length)/4096);*/

//for(double i=0; inosofpackets; i++)
//for(double i=0; i4; i++)
// {
//bytes = (Integer) null;
 //Log.d(TAG, begin inputstream);
   // bytes = mmInStream.read(buffer);
Log.d(TAG, data incoming);
//System.out.println(bytes);
Log.d(TAG, begin file writing);
//bos.write(buffer, 0,buffer.length);
while((bytes = mmInStream.read(buffer))0){
 Log.d(TAG, data is there for writing);
 bos.write(buffer);}
//}
// Send the obtained bytes to the UI Activity
mHandler.obtainMessage(BluetoothChat.MESSAGE_READ,
bytes, -1, buffer)
.sendToTarget();
} catch (IOException e) {
Log.e(TAG, disconnected, e);
connectionLost();
break;
}
}

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] bluetooth file transfer failure

2013-03-15 Thread akash roy
@Lew

1. file constructors are working well and i am pretty sure about that.
2.since i am trying on some small sized files so int perfect for it.
3.i was actually trying to clean the buffer before inserting any other
details but i didn't noticed that i was deallocating the buffer.
4.the receving code is reposted..


@to all.
and i guess i just got the problem.
i.e. i have inserted the nbr.readline() function in the recevier which is
not required for right now.

Thankyou if i get any further problem i will b back in this thread.
Thankyou again!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] bluetooth file transfer failure

2013-03-13 Thread akash roy
here  i am trying to send a file over bluetooth but its not sending any
data.
here the main problem is that its not sending or receiving any data over
the two devices but they are connected to each other.

on configuring the bluetooth chat example.


Sending code:


 File myFile = new File(message.toURI());
 Double nosofpackets = Math.ceil(((int) myFile.length() )/4096);
 System.out.println(nosofpackets);
 BufferedInputStream bis= new BufferedInputStream(new
FileInputStream(myFile));
 byte[] send = new byte[4096];
 for(double i=0; inosofpackets; i++)
 {
  send = null ;
  a=bis.read(send, 0,send.length);
  Log.d(BluetoothChat, data packet  + i);
  if(a==-1)
  {
  break;
  }
  mChatService.write(send);
 }


Receiving code :


while((bytes = mmInStream.read(buffer))0)
{

Log.d(TAG, data is there for writing);
bos.write(buffer);

}

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers]android bluetooth multi-connect one after another

2012-12-10 Thread akash roy
i have posted this because its  not working like that.


On Mon, Dec 10, 2012 at 12:47 PM, gjs garyjamessi...@gmail.com wrote:

 Hi,

 Then concentrate on getting 1 or 2 devices working with -

 mChatService.connect(device);

 Regards

 On Sunday, December 9, 2012 1:19:08 AM UTC+11, akash roy wrote:

 please have a look on it..thankyou.



 On Sat, Dec 8, 2012 at 9:26 AM, akash roy akashr...@gmail.com wrote:

  **

 here i am trying to connect multiple devices one after another at one
 go. now if it connects to a device it will send the message else it will
 try to connect the next paired device. here the main problem is that its
 not connecting any device rather getting skipped one after other , before
 they get connected to each other.

 --**--**
 -

 for( BluetoothDevice device : PairedDevice)
 {
 mChatService.connect(device);
 try
 {
 SendMessage(message); //message is a string object
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }

 --**--**--




 --
 *AKASH ROY*
 *3RD YEAR
 *
 *COMPUTER SCIENCE AND ENGG.*
 *N.I.T. DURGAPUR*
 *
 *

   --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
*AKASH ROY*
*3RD YEAR
*
*COMPUTER SCIENCE AND ENGG.*
*N.I.T. DURGAPUR*
*
*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers]android bluetooth multi-connect one after another

2012-12-08 Thread akash roy
please have a look on it..thankyou.



On Sat, Dec 8, 2012 at 9:26 AM, akash roy akashroy.n...@gmail.com wrote:

  **

 here i am trying to connect multiple devices one after another at one go.
 now if it connects to a device it will send the message else it will try to
 connect the next paired device. here the main problem is that its not
 connecting any device rather getting skipped one after other , before they
 get connected to each other.


 -

 for( BluetoothDevice device : PairedDevice)
 {
 mChatService.connect(device);
 try
 {
 SendMessage(message); //message is a string object
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }

 --




-- 
*AKASH ROY*
*3RD YEAR
*
*COMPUTER SCIENCE AND ENGG.*
*N.I.T. DURGAPUR*
*
*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers]android bluetooth multi-connect one after another

2012-12-07 Thread akash roy
 **

here i am trying to connect multiple devices one after another at one go.
now if it connects to a device it will send the message else it will try to
connect the next paired device. here the main problem is that its not
connecting any device rather getting skipped one after other , before they
get connected to each other.

-

for( BluetoothDevice device : PairedDevice)
{
mChatService.connect(device);
try
{
SendMessage(message); //message is a string object
}
catch(Exception e)
{
e.printStackTrace();
}
}

--

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: [Android-developers]:need help in creating bluetooth file transfer app. urgent

2012-10-25 Thread akash roy
thanx bob i  did that already...here is my sample code :


sender :

File myFile = new File(message.toURI());
nosofpackets=Math.ceil(( (int)myFile.length())/4096);
//mChatService.writeda(
message.getName(), myFile.length());
for(double i=0; inosofpackets; i++)
{
BufferedInputStream bis = new BufferedInputStream(new
FileInputStream(myFile));
byte[] send = new byte[4096];
bis.read(send, 0,send.length);
mChatService.write(send);
}

receiver code as follows.
receiver:

Log.d(TAG, begin inputstream);
bytes = mmInStream.read(buffer);
Log.d(TAG, data incoming);
System.out.println(bytes);
Log.d(TAG, begin file writing);
//bos.write(buffer, 0,buffer.length);
while((bytes = mmInStream.read(buffer))0){
Log.d(TAG, data is there for writing);
bos.write(buffer);}

i am getting a prob ..i.e when i am sending data from one cell to another
..the receiver file is getting too large and corrupted.plz help me.
its not working properly.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] sending large file transfer problem

2012-10-16 Thread akash roy
this is a code for sending data streaming for file transfer.

sender :

File myFile = new File(message.toURI());
nosofpackets=Math.ceil(( (int)myFile.length())/4096);
//mChatService.writeda(message.getName(), myFile.length());
for(double i=0; inosofpackets; i++)
{
BufferedInputStream bis = new BufferedInputStream(new
FileInputStream(myFile));
byte[] send = new byte[4096];
bis.read(send, 0,send.length);
mChatService.write(send);
}

receiver code as follows.
receiver:

Log.d(TAG, begin inputstream);
bytes = mmInStream.read(buffer);
Log.d(TAG, data incoming);
System.out.println(bytes);
Log.d(TAG, begin file writing);
//bos.write(buffer, 0,buffer.length);
while((bytes = mmInStream.read(buffer))0){
Log.d(TAG, data is there for writing);
bos.write(buffer);}

i am getting a prob ..i.e when i am send data from one cell to another
..the receiver file is getting too large and corrupted.plz help me.
its not working properly.
thankyou

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers]

2012-10-16 Thread akash roy
this is a code for sending data streaming for file transfer.

sender :

File myFile = new File(message.toURI());
nosofpackets=Math.ceil(( (int)myFile.length())/4096);
//mChatService.writeda(message.getName(), myFile.length());
for(double i=0; inosofpackets; i++)
{
BufferedInputStream bis = new BufferedInputStream(new
FileInputStream(myFile));
byte[] send = new byte[4096];
bis.read(send, 0,send.length);
mChatService.write(send);
}

receiver code as follows.
receiver:

Log.d(TAG, begin inputstream);
bytes = mmInStream.read(buffer);
Log.d(TAG, data incoming);
System.out.println(bytes);
Log.d(TAG, begin file writing);
//bos.write(buffer, 0,buffer.length);
while((bytes = mmInStream.read(buffer))0){
Log.d(TAG, data is there for writing);
bos.write(buffer);}

i am getting a prob ..i.e when i am send data from one cell to another
..the receiver file is getting too large and corrupted.plz help me.
its not working properly.
thankyou

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: [Android-developers]:need help in creating bluetooth file transfer app. urgent

2012-10-10 Thread akash roy
i want send a file so what changes i have to make.?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] [Android-developers]:need help in creating bluetooth file transfer app. urgent

2012-10-09 Thread akash roy
i am currently on a project and i need to share files from one device to
another with the help of bluetooth. so i thought of changing the codes from
the bluetooth chat demo that is available in android developer's site .
actually i need to simply send a text file . but i am getting some issues
in that code due to which i could not rectify my problem. so if any of you
can send me a sample for sharing files using bluetooth then i think then it
could be a great help to me.

Thankyou

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: [Android-developers]:need help in creating bluetooth file transfer app. urgent

2012-10-09 Thread akash roy
and i m very new on this android developing.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] problem with apk file in 2.3.6

2012-06-29 Thread akash roy
thanx to all...
I got the solution..there was a mismatch of android sdk version...i coded
it in 2.2 and it worked on that samsung android phn galaxy s2
..
again thanx a lot..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] problem with apk file in 2.3.6

2012-06-28 Thread akash roy
i have written a code in android version 2.3.3..
the code is running properly in android 2.3.3 emulator but when i installed
the apk file in samsung galaxy sII G2560 whose version is 2.3.6...such that
only splash screen  r working in it and exit button is working,...other
than that..none other codes are working..its showing some exceptions..
it would be great if u all just have look on it..
Thanku

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Is it possible to set WifiP2pDevice.secondaryDeviceType ?

2012-05-30 Thread akash roy
http://developer.android.com/resources/samples/WiFiDirectDemo/index.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers]

2012-05-30 Thread akash roy
how should i switch on wifi in android virtual machine..in laptop..?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en