Problems with Pocket PC application development using a web service

Started by Blizzard, June 22, 2008, 12:53:41 pm

Previous topic - Next topic

Blizzard

<3



In other words: I am using an operating system emulator to emulate a Pocket PC OS and then I connect with that emulator to the internet over my laptop's wireless card and browse CP. <3 <3 <3
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.


Diokatsu

he's using a virtual machine to run windows mobile i beleive which he then connected to the intorrnet through.......that hurts blizz....my brain went kablewwey...i will take you on though!

Valcos

"We are all in the gutter, but some of us are looking at the stars."
-Oscar De La Hoya

Starrodkirby86

He's using a Pocket PC to connect to CP. But the catch is, the Pocket PC is emulated like ZSNES or VisualBoyAdvance. So in other words, he's connecting on the PC with the emulator...which is interesting indeed. But I see little use other than IP Masking, which I even doubt would work since it still uses the main connection rather than Bluetooth...am I right?

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Diokatsu

i doubt there's a point other than proving he'll go to the trouble to do all than.....

Calintz


Vell


Calintz


Diokatsu

he's just showing that he emulates OS' for no reason....waste of time!!!! i'll 1-up u though still

Vell


Diokatsu


Valcos

Lmao... oh i thought there was an actually purpose :P... Blizz how do you find it fun looks at stuff through a little window ;D?
"We are all in the gutter, but some of us are looking at the stars."
-Oscar De La Hoya

Vell


Blizzard

Quote from: Starrodkirby86 on June 22, 2008, 06:00:37 pm
He's using a Pocket PC to connect to CP. But the catch is, the Pocket PC is emulated like ZSNES or VisualBoyAdvance. So in other words, he's connecting on the PC with the emulator...which is interesting indeed. But I see little use other than IP Masking, which I even doubt would work since it still uses the main connection rather than Bluetooth...am I right?


That's more or less correct. The emulated OS doesn't connect "over" the hosting OS (WinXP), but uses the connection on its own. It's not really IP masking since they both have valid and different IP addresses assigned by DHCP where I connect to the internet. i.e. my IP was 161.53.76.49 at that moment, the Pocket PC's was 161.53.76.208.

I was just happy that I managed to do that so I posted it since it's cool in a geeky way. :P Sadly this was just one of the simplier steps in achieving my actual goal. That goal was to program a web service which is then hosted on my laptop over IIS. Then I would create a program that runs on Pocket PCs which connects to the internet and accesses that web service in order to get, modify and store data located in a database also run on my PC over an SQL server. Well, that program that runs on Pocket PCs is what my goal was, but I couldn't test it until I set up everything else. Even though the code is very simple, I can't just code blind. xD

Spoiler: ShowHide
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Globalization;

using Expenses.WebService;

namespace Expenses
{
    public partial class Expense : Form
    {
        // web service referenca
        WebService service = new WebService();
        // current data
        ExpensePriority[] dataList;

        public Expense()
        {
            InitializeComponent();
        }

        private void Expense_Load(object sender, System.EventArgs e)
        {
            // Croatian version of the current day in the week
            CultureInfo croatian = CultureInfo.GetCultureInfo("hr-HR");
            int day = (int)DateTime.Now.DayOfWeek;
            labelDan.Text = croatian.DateTimeFormat.DayNames[day];
            labelDatum.Text = DateTime.Now.ToString("dd.MM.yyyy");
           
            refreshData();
        }
        // refresh button press
        private void menuRefresh_Click(object sender, EventArgs e)
        {
            refreshData();
        }
        // refreshes data display when selecting another cell in the datagrid
        private void dgvPriority_CurrentCellChanged(object sender, EventArgs e)
        {
            refreshDisplay();
        }
        // refreshes data from the database
        private void refreshData()
        {
            // get all data
            dataList = service.PriorityFetchAll();
            int index = dgvPriority.CurrentRowIndex;
            // set all data to the datagrid
            dgvPriority.DataSource = dataList;
            // if the index is valid, set it back after databinding
            if (index >= 0 && index < dataList.Length)
            {
                dgvPriority.CurrentRowIndex = index;
            }
           
            refreshDisplay();
        }
        // refreshes data display
        private void refreshDisplay()
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                int index = dgvPriority.CurrentRowIndex;
                textBoxName.Text = dataList[index].NamePriority;
                numericRating.Value = new decimal((int)dataList[index].RatingPriority);
            }
        }
        // delete button press
        private void menuDelete_Click(object sender, EventArgs e)
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                int index = dgvPriority.CurrentRowIndex;
                // delete that entry
                service.PriorityDelete(dataList[index]);
               
                refreshData();
            }
        }
        // store button press
        private void menuSave_Click(object sender, EventArgs e)
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                // update entry
                int index = dgvPriority.CurrentRowIndex;
                dataList[index].NamePriority = textBoxName.Text;
                dataList[index].RatingPriority = decimal.ToInt32(numericRating.Value);
                // update entry in database
                service.PriorityUpdate(dataList[index]);
               
                refreshData();
            }
        }
        // new entry button press
        private void menuAdd_Click(object sender, EventArgs e)
        {
            // new entry
            ExpensePriority newRow = new ExpensePriority();
            newRow.IDPriority = 0;
            newRow.NamePriority = textBoxName.Text;
            newRow.RatingPriority = decimal.ToInt32(numericRating.Value);
            // add into database
            service.PriorityInsert(newRow);
           
            refreshData();
        }
    }
}


This doesn't include the designer generated code where all the controls are defined.

And I'm moving this topic since Ulta started spamming it even though it starts turning out kind of useful. (-_-')
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Starrodkirby86

Quote from: Blizzard on June 23, 2008, 04:29:15 am
Quote from: Starrodkirby86 on June 22, 2008, 06:00:37 pm
He's using a Pocket PC to connect to CP. But the catch is, the Pocket PC is emulated like ZSNES or VisualBoyAdvance. So in other words, he's connecting on the PC with the emulator...which is interesting indeed. But I see little use other than IP Masking, which I even doubt would work since it still uses the main connection rather than Bluetooth...am I right?


That's more or less correct. The emulated OS doesn't connect "over" the hosting OS (WinXP), but uses the connection on its own. It's not really IP masking since they both have valid and different IP addresses assigned by DHCP where I connect to the internet. i.e. my IP was 161.53.76.49 at that moment, the Pocket PC's was 161.53.76.208.

I was just happy that I managed to do that so I posted it since it's cool in a geeky way. :P Sadly this was just one of the simplier steps in achieving my actual goal. That goal was to program a web service which is then hosted on my laptop over IIS. Then I would create a program that runs on Pocket PCs which connects to the internet and accesses that web service in order to get, modify and store data located in a database also run on my PC over an SQL server. Well, that program that runs on Pocket PCs is what my goal was, but I couldn't test it until I set up everything else. Even though the code is very simple, I can't just code blind. xD

Spoiler: ShowHide
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Globalization;

using Expenses.WebService;

namespace Expenses
{
    public partial class Expense : Form
    {
        // web service referenca
        WebService service = new WebService();
        // current data
        ExpensePriority[] dataList;

        public Expense()
        {
            InitializeComponent();
        }

        private void Expense_Load(object sender, System.EventArgs e)
        {
            // Croatian version of the current day in the week
            CultureInfo croatian = CultureInfo.GetCultureInfo("hr-HR");
            int day = (int)DateTime.Now.DayOfWeek;
            labelDan.Text = croatian.DateTimeFormat.DayNames[day];
            labelDatum.Text = DateTime.Now.ToString("dd.MM.yyyy");
           
            refreshData();
        }
        // refresh button press
        private void menuRefresh_Click(object sender, EventArgs e)
        {
            refreshData();
        }
        // refreshes data display when selecting another cell in the datagrid
        private void dgvPriority_CurrentCellChanged(object sender, EventArgs e)
        {
            refreshDisplay();
        }
        // refreshes data from the database
        private void refreshData()
        {
            // get all data
            dataList = service.PriorityFetchAll();
            int index = dgvPriority.CurrentRowIndex;
            // set all data to the datagrid
            dgvPriority.DataSource = dataList;
            // if the index is valid, set it back after databinding
            if (index >= 0 && index < dataList.Length)
            {
                dgvPriority.CurrentRowIndex = index;
            }
           
            refreshDisplay();
        }
        // refreshes data display
        private void refreshDisplay()
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                int index = dgvPriority.CurrentRowIndex;
                textBoxName.Text = dataList[index].NamePriority;
                numericRating.Value = new decimal((int)dataList[index].RatingPriority);
            }
        }
        // delete button press
        private void menuDelete_Click(object sender, EventArgs e)
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                int index = dgvPriority.CurrentRowIndex;
                // delete that entry
                service.PriorityDelete(dataList[index]);
               
                refreshData();
            }
        }
        // store button press
        private void menuSave_Click(object sender, EventArgs e)
        {
            // if the index is valid
            if (dgvPriority.CurrentRowIndex >= 0)
            {
                // update entry
                int index = dgvPriority.CurrentRowIndex;
                dataList[index].NamePriority = textBoxName.Text;
                dataList[index].RatingPriority = decimal.ToInt32(numericRating.Value);
                // update entry in database
                service.PriorityUpdate(dataList[index]);
               
                refreshData();
            }
        }
        // new entry button press
        private void menuAdd_Click(object sender, EventArgs e)
        {
            // new entry
            ExpensePriority newRow = new ExpensePriority();
            newRow.IDPriority = 0;
            newRow.NamePriority = textBoxName.Text;
            newRow.RatingPriority = decimal.ToInt32(numericRating.Value);
            // add into database
            service.PriorityInsert(newRow);
           
            refreshData();
        }
    }
}


This doesn't include the designer generated code where all the controls are defined.

And I'm moving this topic since Ulta started spamming it even though it starts turning out kind of useful. (-_-')
It seems to me you can finish this if only the boundary of time were to not be there. So does that mean if the main computer does not have an available connection, the Pocket PC may still have the chance to connect the Internet? That's really interesting.

A web service, as in a browser or an ISP?

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Blizzard

Lol, no, of course a connection is needed by the hosting OS so that the emulated OS can actually connect. I'm not sure if the connection has to be enabled, though.

No, web service as in a compiled .dll file with implemented methods to access the SQL database located on the same server.

And I managed to finish it all before the deadline. The deadline was midnight, I was done with all of it around 21:30. <3 A collegue took my code, copy pasted it and edited what she needs (I told her to do so) as she couldn't run the emulator for some reason. We compiled and debugged it on my machine and submitted her project solution as well. ^_^
The actual biggest problem was running the web service and actually being able to connect to my machine. She wasn't able to set it up right on her machine. If she could have run her emulator, she could have connected to my web service, though.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Starrodkirby86

Quote from: Blizzard on June 23, 2008, 11:11:49 am
Lol, no, of course a connection is needed by the hosting OS so that the emulated OS can actually connect. I'm not sure if the connection has to be enabled, though.

No, web service as in a compiled .dll file with implemented methods to access the SQL database located on the same server.

And I managed to finish it all before the deadline. The deadline was midnight, I was done with all of it around 21:30. <3 A collegue took my code, copy pasted it and edited what she needs (I told her to do so) as she couldn't run the emulator for some reason. We compiled and debugged it on my machine and submitted her project solution as well. ^_^
The actual biggest problem was running the web service and actually being able to connect to my machine. She wasn't able to set it up right on her machine. If she could have run her emulator, she could have connected to my web service, though.

Oh...that seems not as hard as the my previous two possibilities. In that case anyway, congratulations. Usually stuff always happens after the deadline, after all, look at Brawl, Twilight Princess, and the like...Massive delays. That could've happened, but you went through. Great job, Blizz. :)

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Diokatsu

thats pretty sweet regardless....i hadn't relized just what u were doing there till after you explained it. nice work!