Hi,
I have played with NetChickens first example in his manual, (see below) and tried to use HttpUtils2. The idea is to type in a word, hit the lookup button and the ap looks up dictionary.com and downloads the definition page.
My problem is this, the first time I use the ap it works as expected, if however I type in a new word it doesn't work at all.
From checking the logs it seems on subsequent trys the job success is false?
If I change Job.Release to Activity.Complete, it still wont work twice.
Getting a bit lost and discouraged here as I'm new to this, any help would be Great
Steve
#Region Project Attributes
#ApplicationLabel: HttpDictionary
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim DictLookup As HttpJob
Dim SearchButton As Button
Dim WordBox As EditText
Dim StrDict As String
StrDict = "http://dictionary.reference.com/browse/"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
DictLookup.Initialize("HttpUtils",Me)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SearchButton_Click
DictLookup.Download(StrDict & WordBox.Text)
End Sub
Sub JobDone(Job As HttpJob)
Dim SearchWord As String
If Job.Success Then
SearchWord = Job.GetString
SearchWord = SearchWord.Replace(QUOTE, "'")
SearchWord = SearchWord.SubString(SearchWord.IndexOf("<meta name='description' content=")+34)
SearchWord=SearchWord.SubString2(0, SearchWord.IndexOf("See more"))
Msgbox(WordBox.Text & SearchWord, "")
End If
Job.Release
End Sub
I have played with NetChickens first example in his manual, (see below) and tried to use HttpUtils2. The idea is to type in a word, hit the lookup button and the ap looks up dictionary.com and downloads the definition page.
My problem is this, the first time I use the ap it works as expected, if however I type in a new word it doesn't work at all.
From checking the logs it seems on subsequent trys the job success is false?
If I change Job.Release to Activity.Complete, it still wont work twice.
Getting a bit lost and discouraged here as I'm new to this, any help would be Great
Steve
#Region Project Attributes
#ApplicationLabel: HttpDictionary
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim DictLookup As HttpJob
Dim SearchButton As Button
Dim WordBox As EditText
Dim StrDict As String
StrDict = "http://dictionary.reference.com/browse/"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
DictLookup.Initialize("HttpUtils",Me)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SearchButton_Click
DictLookup.Download(StrDict & WordBox.Text)
End Sub
Sub JobDone(Job As HttpJob)
Dim SearchWord As String
If Job.Success Then
SearchWord = Job.GetString
SearchWord = SearchWord.Replace(QUOTE, "'")
SearchWord = SearchWord.SubString(SearchWord.IndexOf("<meta name='description' content=")+34)
SearchWord=SearchWord.SubString2(0, SearchWord.IndexOf("See more"))
Msgbox(WordBox.Text & SearchWord, "")
End If
Job.Release
End Sub