Needs to get simple update info

H

HSS

I've got a ridiculously simple app that "may" need to get updated info
(parameters etc.) from time to time.
Seems like overkill to create a web service just to get this little bit of
info.

Almost seems like downloading the "updated" app altogether would be about as
easy since it is a small app.

Any ideas on a way a PPC app could quickly get a few numbers from a central
location quickly if the device was activesynced to the computer?

May be the web service is the quickest cheapest way to go.

TIA
Harry
 
P

Paul G. Tobey [eMVP]

You can write a desktop application using the Remote API, RAPI, to do
various things to the device. You wouldn't be able to get that done over a
network, only via ActiveSync.

Paul T.
 
H

HSS

Thanks Paul,

Yes it'd be an ActiveSync connection so it could hit the web service this
way to get inforamtion if the application was running.

Harry

I was just wondering if the app could pull down a file quickly - I've used
the ol'
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath), HttpWebRequest)

Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

Dim str As Stream = ws.GetResponseStream()

Dim inBuf(1000000) As Byte

Dim bytesToRead As Integer = CInt(inBuf.Length)

Dim bytesRead As Integer = 0

Try

While bytesToRead > 0

Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)

If n = 0 Then

Exit While

End If

bytesRead += n

bytesToRead -= n

End While









Dim fi As FileInfo

If File.Exists("\Application\" & strJustTheFileName) Then

fi = New FileInfo("\Application\" & strJustTheFileName)

fi.Attributes = FileAttributes.Normal

End If

Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)

fstr.Write(inBuf, 0, bytesRead)

str.Close()

fstr.Close()

inBuf = Nothing

fi.Attributes = FileAttributes.ReadOnly

Catch ex As Exception

End Try

Next

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
 
P

Paul G. Tobey [eMVP]

Well, since you're connected to the device, in the ActiveSync case, you
don't need a Web service at all. It could stop the application if it's
running, copy a new version, and start the new version behind the scenes.

You could do what you describe, more or less, yes. For that matter, you
could just put the settings file, maybe a .txt file, in the synchronized
files folder on the PC and it would be copied to the device any time it was
newer. You'd have to be careful not to modify the file on the device, so it
didn't get synced the other direction, of course.

Paul T.

HSS said:
Thanks Paul,

Yes it'd be an ActiveSync connection so it could hit the web service this
way to get inforamtion if the application was running.

Harry

I was just wondering if the app could pull down a file quickly - I've used
the ol'
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath),
HttpWebRequest)

Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

Dim str As Stream = ws.GetResponseStream()

Dim inBuf(1000000) As Byte

Dim bytesToRead As Integer = CInt(inBuf.Length)

Dim bytesRead As Integer = 0

Try

While bytesToRead > 0

Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)

If n = 0 Then

Exit While

End If

bytesRead += n

bytesToRead -= n

End While









Dim fi As FileInfo

If File.Exists("\Application\" & strJustTheFileName) Then

fi = New FileInfo("\Application\" & strJustTheFileName)

fi.Attributes = FileAttributes.Normal

End If

Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)

fstr.Write(inBuf, 0, bytesRead)

str.Close()

fstr.Close()

inBuf = Nothing

fi.Attributes = FileAttributes.ReadOnly

Catch ex As Exception

End Try

Next

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
You can write a desktop application using the Remote API, RAPI, to do
various things to the device. You wouldn't be able to get that done over
a network, only via ActiveSync.

Paul T.
 
H

HSS

Thanks Paul,

Updated info on a central server....so the file sync - would that still
work? I 'd figure i'll just do a web service and let the device use an http
connection to access the web service for the updated info.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
Well, since you're connected to the device, in the ActiveSync case, you
don't need a Web service at all. It could stop the application if it's
running, copy a new version, and start the new version behind the scenes.

You could do what you describe, more or less, yes. For that matter, you
could just put the settings file, maybe a .txt file, in the synchronized
files folder on the PC and it would be copied to the device any time it
was newer. You'd have to be careful not to modify the file on the device,
so it didn't get synced the other direction, of course.

Paul T.

HSS said:
Thanks Paul,

Yes it'd be an ActiveSync connection so it could hit the web service this
way to get inforamtion if the application was running.

Harry

I was just wondering if the app could pull down a file quickly - I've
used the ol'
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath),
HttpWebRequest)

Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

Dim str As Stream = ws.GetResponseStream()

Dim inBuf(1000000) As Byte

Dim bytesToRead As Integer = CInt(inBuf.Length)

Dim bytesRead As Integer = 0

Try

While bytesToRead > 0

Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)

If n = 0 Then

Exit While

End If

bytesRead += n

bytesToRead -= n

End While









Dim fi As FileInfo

If File.Exists("\Application\" & strJustTheFileName) Then

fi = New FileInfo("\Application\" & strJustTheFileName)

fi.Attributes = FileAttributes.Normal

End If

Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)

fstr.Write(inBuf, 0, bytesRead)

str.Close()

fstr.Close()

inBuf = Nothing

fi.Attributes = FileAttributes.ReadOnly

Catch ex As Exception

End Try

Next

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:%[email protected]...
You can write a desktop application using the Remote API, RAPI, to do
various things to the device. You wouldn't be able to get that done
over a network, only via ActiveSync.

Paul T.

I've got a ridiculously simple app that "may" need to get updated info
(parameters etc.) from time to time.
Seems like overkill to create a web service just to get this little bit
of info.

Almost seems like downloading the "updated" app altogether would be
about as easy since it is a small app.

Any ideas on a way a PPC app could quickly get a few numbers from a
central location quickly if the device was activesynced to the
computer?

May be the web service is the quickest cheapest way to go.

TIA
Harry
 
P

Paul G. Tobey [eMVP]

You'd have to play with things and see if putting a shortcut to a server
folder in your synchronized files folder for AS would sync the contents from
the server. But, you're right, that is a potential stumbling block.

Note that, if the application has to be updated (the EXE), you'll have to
have some means of exiting the application, copying the new file (note that
the application, obviously, can't be the one to do this), and then
restarting the application.

Paul T.

HSS said:
Thanks Paul,

Updated info on a central server....so the file sync - would that still
work? I 'd figure i'll just do a web service and let the device use an
http connection to access the web service for the updated info.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
Well, since you're connected to the device, in the ActiveSync case, you
don't need a Web service at all. It could stop the application if it's
running, copy a new version, and start the new version behind the scenes.

You could do what you describe, more or less, yes. For that matter, you
could just put the settings file, maybe a .txt file, in the synchronized
files folder on the PC and it would be copied to the device any time it
was newer. You'd have to be careful not to modify the file on the
device, so it didn't get synced the other direction, of course.

Paul T.

HSS said:
Thanks Paul,

Yes it'd be an ActiveSync connection so it could hit the web service
this way to get inforamtion if the application was running.

Harry

I was just wondering if the app could pull down a file quickly - I've
used the ol'
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath),
HttpWebRequest)

Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

Dim str As Stream = ws.GetResponseStream()

Dim inBuf(1000000) As Byte

Dim bytesToRead As Integer = CInt(inBuf.Length)

Dim bytesRead As Integer = 0

Try

While bytesToRead > 0

Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)

If n = 0 Then

Exit While

End If

bytesRead += n

bytesToRead -= n

End While









Dim fi As FileInfo

If File.Exists("\Application\" & strJustTheFileName) Then

fi = New FileInfo("\Application\" & strJustTheFileName)

fi.Attributes = FileAttributes.Normal

End If

Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)

fstr.Write(inBuf, 0, bytesRead)

str.Close()

fstr.Close()

inBuf = Nothing

fi.Attributes = FileAttributes.ReadOnly

Catch ex As Exception

End Try

Next

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message
You can write a desktop application using the Remote API, RAPI, to do
various things to the device. You wouldn't be able to get that done
over a network, only via ActiveSync.

Paul T.

I've got a ridiculously simple app that "may" need to get updated info
(parameters etc.) from time to time.
Seems like overkill to create a web service just to get this little
bit of info.

Almost seems like downloading the "updated" app altogether would be
about as easy since it is a small app.

Any ideas on a way a PPC app could quickly get a few numbers from a
central location quickly if the device was activesynced to the
computer?

May be the web service is the quickest cheapest way to go.

TIA
Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top