Some questions about Android.

Previous topic - Next topic

Hatonastick

Ignoring questions like "Why would you want to?", I'm curious as to whether or not I could write a simple MUD server for Android devices.  Mostly for my own fun.  You can blame my discovering the large number of MUD clients for Android as being the catalyst. :)

a) Can you have a program run as a server under Android without "rooting" the device?  If I have to use higher port numbers that's fine eg. 8080.

b) Is there a built-in database system or would I have to make my own (limited) system?  I'm guessing I'd have to read/write memory cards or provide a way to change where the game data directory is...

c) Is there anything else that might make the whole idea impossible?  Ignoring device speed, this isn't going to be much of a MUD server.  Think very, very simplistic.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Kitty Hello

a) I don't think there's a technical problem to listen to port 8080.

b) You might need to keep your own structures. There was a start of a QSlite port, but it's not finished.

c) What is an MUD?

Hatonastick

Quote from: Kitty Hello on 2011-Oct-27
a) I don't think there's a technical problem to listen to port 8080.

b) You might need to keep your own structures. There was a start of a QSlite port, but it's not finished.

c) What is an MUD?
a) Yeah I think it's only if you want to listen to a port under 1024 if it's like Linux.

b) Well not a problem there.  Does the INI read/write system work under Android?  If so I might use that.  I only really need a key:data pair system.  Hmm wonder what the limit on open files at one time is with Android.

c) A MUD is Multi-User Dungeon/Dimension.  Just a multi-player text adventure with RPG elements.  The precursor to MMO's to a certain extent.  I was a big adventure game fan on the 8 and 16-bit days, so when I discovered MUDs in the late 80's I was hooked.  Even wrote my own at one point in C.  This is going to be much simpler though than that was.  Essentially it's a telnet server at its core.  The one I wrote in C had full telnet negotiation built in.  I'm planning to add that again.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Crivens

Coincidentally I thought of doing a MUD project for mobile devices yesterday. It would be carrying on with a project I started years ago but using GLB as the client. 

Basically I wrote a simple MUD server in ASP for a DarkBasic text adventure competition a few years ago. I ended up becoming a judge which disallowed me from entering so I dropped the project. Is a pretty simple effort but it got to the stage of allowing you to walk around and talk to other people.

Hmmm, that or at least a GUI-MUD would be interesting... I'm thinking graphically Valhallaish (remember swearing at Mary the dwarf) with trading and quest elements... Hmm...

Cheers

Current fave quote: Cause you like musicians and I like people with boobs.

Hatonastick

Hmm interesting idea.  Never played that game so looked it up.  Must admit a MUD with graphics would be fun, only thing is one of the reasons why I chose a text MUD was so I wouldn't have to do graphics. ;)

Still...  It could be interesting.  Instead of text describing everything, could use graphical presentation like Valhalla or the old Kings Quest games.  Text interface, but could click on things in the screen which would then get a text response eg. click on an apple on a tree, and get a response in the text window like "It's an apple.  It may contain a worm."  The downside such an approach would make the whole "build and add to the game while logged in" thing you can do with traditional text-based MUDs.  I was planning on doing that with mine -- being able to build and add to the world while you are in it is one of the things that attracted me to MUDs in the first place.  With my project if I added graphics I'd probably need to turn it into Minecraft or something to keep that ability. :)
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Crivens

I see what you are saying, but I'm talking very simple retro graphics here. Valhalla for example was generic as hell. One screen had a castle, and another had a manor. They were exactly the same but the castle had a couple of spires on it. That sort of thing. Plus it's just a single screen (ie. room based like a MUD) with a few 2D graphics plonked on, not a scrolling massive area. And putting a complete text MUD onto a portable touchscreen device might not work that well. A couple of the iPhone text adventure games I've used don't quite work the same. Might be better on an iPad though with the extra space to put the virtual keyboard.

Also look at Lords of Midnight (the original Speccy version not the remade 3D effort). Again a 2D world that could be easily moved into a MUD type game without the overheads of something like a MMORPG. Although saying that there is no reason why you couldn't get a battle encounter to sync up all devices into a more traditional multiplayer game (like you can with Game Center). Otherwise it's just a matter of checking every couple of seconds who is still in the room you are in (rather than every 10th of a second or so about where every character is and what they are doing etc etc).

Hmm, once I finish my current project I may just give this a bit of a go. Would be interesting and not that difficult really (considering I have done most of the hardwork on the server already even though it was years ago).

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Hatonastick

#6
I originally thought of making a MUD server for Android simply because there are so many MUD clients already on the platform, so I wouldn't be making the client -- just the server. :)

Another reason is I've always wanted to make a MUD server for portable devices.  A long time ago, in a dark and distant galaxy I owned several Atari Portfolios.  There was in existence a very simplistic PPP set-up someone had hacked together that used the serial expansion and a modem -- I had both.  So I was looking into the possibility of making the worlds most simplistic, hard-coded MUD for that platform in C on top of that 'driver'.  Would have barely classified as a MUD actually. :)  So I've got a bit of a bee in my bonnet for this sort of thing. :)

Anyway I'd love to see your project so hope you do take it up. :)

I'm attempting to get an example GLB program running on my tablet at the moment.  Am wondering if I've done this bit wrong:

Add an environment variable in windows control center: JAVA_HOME=C:\program Files (x86)\Java\jdk1.x.x_xx (where your Java is installed)

The way I added the variable was under System Properties and Environment Variables.  Was this right?  Hmm and do I need to reboot?

Anyway I have the JDK installed, Android SDK installed, tablet connected, project set as Android, I build it and nothing seems to happen.  Erm I mean it compiles and that's it.  Is there something I'm meant to do next?  Or has something possibly gone wrong somewhere?  Oh and yes the Android device is running a version of Android supported by GLB.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Crivens

Hmm, a MUD server? Interesting idea. I must admit MUDs still hold a lot of interest for me.

Reboot everything. I did the same thing and nothing worked. After I rebooted the device and the PC it all worked. Is a bit slow (WebOS still rules as the fastest for mobile devices for me although iOS isn't too bad) to compile and transfer but it did it in the end.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

So, it's something like a "rougelike", but text only?
That sounds very cool. Keep in mind, that a great audience of blind players could play this (with text to speech)

Hatonastick

#9
Now text-to-speech would be very cool. :)

BTW Kitty I can't get something compiled and onto my Android tablet for some reason.  I've even rebooted both after doing all the other steps in the Help.  I'm only using the sample HelloWorld that comes with GLB.

Now when I plug my Android tablet into my PC it says on the tablets screen something like "USB Connected".  It also has a button down the bottom of the screen that says "Turn on USB storage".  Does GLB need either of these things when I compile?

Edit: Maybe my problem is the step in the help that says "Install drivers".  I mean I do have the Android SDK installed, but what drivers are we talking about?  My PC connects to my tablet and I can access its SDCard like a memory stick just fine.  Is there something else I need?

Edit:  Ah...  Found another thread about this sort of thing.  Tried 'adb usb' and got an error message saying no device found, and 'adb devices' is a blank list.  Guess that means I don't have the drivers installed.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Kitty Hello

what does the debug log print?
You need usb-debugging drvers for the device. DON'T turn it on as a usb-drive. That's the wrong mode for the device.

Moebius

Not sure if this applies to yours but the Galaxy S has an option in settings to enable "USB debugging" which has to be on, and it has seemed to work without finding additional drivers.  EDIT:  Running '  "adb.exe" usb ' from the tools folder in the android sdk might help, if I'm not mistaken, otherwise google for the drivers...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Hatonastick

#12
Well I've now got the drivers installed.  Turned out I'd downloaded them a few days ago and not installed them.  However now adb.exe fails to start when I run it.  :blink:

adb usb
* daemon not running.  starting it now *
CreateProcess failure, error 2
* failed to start daemon *
error: cannot connect to daemon

Now thing is I got this error just before I installed the drivers and before I rebooted my PC, even though the first few times I used that command it was fine (other than it not being able to find a device).

Also I'm not mounting the SD card anymore.

Edit: Thanks for the tip Serpent.  I've turned that on.  Still can't get adb to run though without the above error.  Weird.  As I said, it happened just before I installed the drivers so don't see how it can be caused by them even though it happens all the time now no matter what I reboot.

Edit:  Weird...  Even if I reboot my PC, no device connected, then run adb I still get that very same error.  So I don't see how it can be my device causing it.  Added some extras to the path environment variable after reading a few posts on other forums about this but no change.

Edit:  Stupid question.  Hmm, do I actually need to use Android SDK manager to download and install relevant APIs first? :)
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Hatonastick

#13
Ok, finally got my Android device and adb working.  Turns out it's a good idea to download the API for at least one of the platforms (I selected Android 2.2), then direct your environment path variable to Android\android-sdk\android-tools\ and use the adb.exe in there instead of the one in Android\android-sdl\tools (which is the one you get if you just download and install the SDK without installing any APIs).  It's also a good idea to make sure that when you install the drivers for your Android device that you make sure they actually did install. :)  Turns out the ZTE does it a weird way.  You run the installer which makes you think you've installed them, but turns out it doesn't actually run the actual driver installer until you plug in a ZTE Android device then select "Run somelongprogramnamethatisactuallythedriverinstaller.exe" from the pop-up window. :P

Anyway I still haven't gotten around to compiling and installing something onto my device, I might have to try tomorrow as it's getting late. :)

Edit:  Hmm ok adb works fine now, but compiling a program as Android in GLB still does nothing.  Program compiles fine, no error messages, but nothing appears on device.  I'm pretty tired so I think I'll just look at it again tomorrow.  I've attached the output from 'adb bugreport'.  No idea if that is useful.  Rather large dump of info though.

Edit: Ok, turns out that firstly I managed to miss the big "Build Multiplatform" button in the Compiler menu.  Selecting Android in there actually made it compile for Android.  Still a bit confused as to why changing platform in the Project Options doesn't seem to have any effect at all, but maybe I'm missing the point.  I'm guessing you actually select platforms in "Build Multiplatform" and then can select individual platforms (from ones chosen) in Project Options.  Otherwise I have no idea.  In any case it now compiles.  The second issue I had was that I had installed the Android SDK into c:\Program Files (x86) which is apparently a big no-no.  Once I'd moved it to a path with no spaces and updated the environment variables everything worked swimmingly.  Just compiled and installed "Hello World" onto my ZTE tablet which then ran it just fine.  So everything seems to work now.  Sorry for the mass of daft questions etc.  =D
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).