This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Android Java P2P File Sharing  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys. I'm trying to build an file sharing app using p2p connection but  I don't know how to send the file. I'm done with the server/client connection and really need help with the file sending part. Please help.
 
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it P2P or client /server? It's either one or the other.

P2P is probably not possible, since devices can't connect to one another on mobile networks.
 
Jason Alexander
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, it's host/client not server/client  
I just need help with the file.
I converted it to base64 string then split the string to bytes because there's a limit in how much bytes you can send.
I know the process but I can't code it  
 
Tim Moores
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what the difference between host/client and client/server is supposed to be, but either way- it's not P2P :-)

Post the relevant code of what you have so far, so we can see what's still missing.
 
Jason Alexander
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using wifi-direct.

right now the program only sends short messages.

 
Jason Alexander
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Tim Moores
Saloon Keeper
Posts: 5344
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code looks like you can use it to send byte arrays. Since a file can be represented as a byte array, what's stopping you from sending files?
 
Jason Alexander
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry. I know the concept I don't know how to code it. So I turn the file into a byte array so I can split it so that I can send it bits by bits then on the receiver side I just compile those bits right? First I send the file name then the file length then compile it to an outputstream but I don't know how  to code that
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!