It's not that you can't do it because of hardware restrictions, it's
that a standard implementation would lend itself to something that
violates a key Android principle.

If you're just doing it for novelty, then by all means do it.  But
that's a different story than a production app.  Since this forum is
for production apps too, I just mention it as a warning to people
intending to develop "real" apps.

Kris

On Wed, Jan 9, 2013 at 7:04 PM, Kevin Duffey <andjar...@gmail.com> wrote:
> While I agree that running a web server of any sort on the android
> phone/tablet is pretty pointless compared to todays entry level cheap
> hardware.. most of these devices are more powerful and capable than my
> development machine was 6..maybe 7 or so years ago, and we wrote cod while
> running a database and web server on those. As some of you said..it's
> possible.. heck it could probably handle a decent load too. Given that I
> *think* there are now ARM based servers being built, I could see where
> rather than buying a beefy multi-cpu 2+ rack system, you could put a bunch
> of these in place as servers to handle a few dozen or so requests and with
> almost no heat and enough power and memory to handle the requests.. a farm
> of these could possibly be comparable to much more expensive, heat
> dissipating hardware that runs multiple vms. At the very least it would be
> pretty cool to see a table full of hundreds of these, all via wifi, just
> servicing web requests ;)
>
>
>
> On Wed, Jan 9, 2013 at 3:25 PM, Kristopher Micinski <krismicin...@gmail.com>
> wrote:
>>
>> Yes, but doing that (as I said) lends itself to an everlasting
>> service: you certainly can't run that code on the UI thread (it will
>> simply barf with an exception), and so the sensible place to put it is
>> in a service..  There might be times when this is acceptable, but you
>> should think about it carefully before doing so to make sure there
>> isn't a better solution.
>>
>> Kris
>>
>> On Wed, Jan 9, 2013 at 6:06 PM, bob <b...@coolfone.comze.com> wrote:
>> > You can definitely create a TCP server on Android.
>> >
>> > The code would look like this:
>> >
>> > ServerSocket serverSocket = null;
>> > boolean listening = true;
>> >
>> > try {
>> > serverSocket = new ServerSocket(1101);
>> > } catch (IOException e) {
>> > System.err.println("Could not listen on port: 1101.");
>> > System.exit(-1);
>> > }
>> >
>> > while (listening)
>> > new Server_Thread(serverSocket.accept()).start();
>> >
>> > serverSocket.close();
>> >
>> >
>> >
>> >
>> > On Wednesday, January 9, 2013 3:41:22 AM UTC-6, tom wrote:
>> >>
>> >> Hi,
>> >>
>> >> why couldn't create webservice  using android?
>> >> if that any reason. if you know that reason...please share with me..
>> >>
>> >> Thanks,
>> >> Tom
>> >
>> > --
>> > 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 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 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 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

Reply via email to