B4A Library ICOSWorldForecast 3.50

Laurent95

Active Member
Licensed User
Longtime User
Hi Laurent and GMan,


Grazie per la vostra collaborazione.

Je vous remercie pour votre collaboration.

Vielen Dank für Ihre Mitarbeit.

Thank you for your collaboration

I think I did some mistake in French.

Hi Giuseppe,

No no your French is good.

Seems there is a problem with the version 3.1, today nothing respond i have crash on all widget installed no longer for version of Android or device.
The log on BA4 send me back that
I don't know enough your new version for understand what happen.
Thank you for your help.

Best regards.
 
Last edited:

Laurent95

Active Member
Licensed User
Longtime User
Hi Laurent, I don't think it has some problem because I use every day and it does not crash to me.

Yes it work in Async now but newer got this problem till now I'll give look

Hi giuseppe,

Today all works good, i don't understand why i have this log yesterday evening.
I will try later to take a look at my code and how i do the things also.

Thank you for your help.

Regards, Laurent.
 

Laurent95

Active Member
Licensed User
Longtime User
Hi, some time is the provider down.

Ok Giuseppe, i will find a way to know it with a result better than a crash
Thank you for your concern about it.

Best regards.
 

Laurent95

Active Member
Licensed User
Longtime User
Hi Giuseppe,

I have something weird who happens with 3.1 version.
If i try to use the function RequestConnectServer2 with a space in the town like 'New York', it return an error.
Unfortunatly i can't save the log, it's so rotten with other debug messages, that disappear too quick, but i have seen that it's returned by the calling of the HTTP Sub in the library. Maybe the space who's not translated with '%20' in the call on internet.
But when i use the function RequestConnectServer in the same conditions it return an empty string. I need to put an underscore instead the space in 'New_York' and it's good, it returns the city of New York with a good spelling.
That's not very easily to use it like that, i bet that many towns have a composed name.
Can you take a look and say me if i did a mistake, and why it return not the same thing in both function, please ?
Thank you.

Best regards, Laurent.

P.S. : Don't bother you too much with the crash who was happened precedently, it seems happened because many big storms on my place at day that the crash came, all operators was in down and didn't work properly, it's not the server I thinks.
 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User



Hi Laurent, I really dont know but I'm working on it and thanks to report it so I can check this too. The next update bring about 40 language fixed FindLocation now work fine and some bug. I think in few days it'll come.
 

Laurent95

Active Member
Licensed User
Longtime User
Hi Laurent, I really dont know but I'm working on it and thanks to report it so I can check this too. The next update bring about 40 language fixed FindLocation now work fine and some bug. I think in few days it'll come.

Hi Giuseppe,

Take your time it's ok.
In more i can say you it's for all composed cities names like Sao Paulo, San Diego, San Francisco, Los Angeles.
If you add an underscore the function return you a list but with many informations like San Franscico, California, United States Of America.
Of course if you try to find one city with all of these informations returned by RequestConnectServer it not work for have the forecast weather, the city isn't recognized..
I haven't tried again with the other function.
Good luck in your research, hopefully you can find what happen without too bothering yourself.

Best regards, Laurent.
 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi Laurent and all, the ICOSWorldForecastFree updated v3.20 what is new.

Added:

the event LocationResult,CancelTimer, FromLatAndLong and FromLocation instead of FindLatAndLong and FindLocation
Fixed FindLatAndLong and FindLocation now work fine and many.

B4X:
Sub a_LocationResult(Result As String, Value As Boolean)
    If (Value) Then
        a.CityName = Result
        StartActivity(Forecast)
    End If
End Sub

This needs to be called onPause() if FromLocation or FromLatAndLong is called from onResume anywhere,to prevent crash, as stated on the same stackoverflow thread. code below.
B4X:
Sub Activity_Pause (UserClosed As Boolean)
    a.CancelTimer
End Sub

I think I've reported all.
 
Last edited:

Thraka

Member
Licensed User
Longtime User
Hello, I'm working with Jakebullet70 on a project and I'm having an issue with this control. Sometimes when reading the sunrise information I get this error:

java.lang.StringIndexOutOfBoundsException: length=0; regionStart=10; regionLength=6

and other times it is OK.

Also, I cannot seem to use the CCIcon with a Bitmap type. I don't know why. I created another post (http://www.b4x.com/android/forum/th...-bitmap-reference-to-a-bitmap-variable.43757/) about it, maybe you can help with that too? Thanks!
 

lonleystar

Well-Known Member
Licensed User
Longtime User


Hi, For the first question I think U've to use SetGeoUserName ="Your User Name" because many people use already my username.

For the second question I read the other post , use this Image.Bitmap = forecastObject.CCIcon instead of Image = forecastObject.CCIcon U'll see it working.
 

Thraka

Member
Licensed User
Longtime User
My image variable is already a Bitmap type:

B4X:
Dim Image As Bitmap

I almost have a feeling it's something to do with this being parsed so close to the activity loading maybe. Unsure.. I actually just bypassed it currently by hand loading the images based on the filename of the CCIconUrl...

As regards using SetGeoUserName = "User name" I tried a bunch of random characters, but it still didn't solve the problem.
 

Thraka

Member
Licensed User
Longtime User
It seems you have a typo in the only event supplied by the library. It is called LocationResul instead of LocationResult. Also, when does this event get fired?
 

lonleystar

Well-Known Member
Licensed User
Longtime User

Hi, the CCIconUrl return this string ( http://cdn.worldweatheronline.net/images/wsymbols01_png_64/wsymbol_0001_sunny.png )
 

lonleystar

Well-Known Member
Licensed User
Longtime User
It seems you have a typo in the only event supplied by the library. It is called LocationResul instead of LocationResult. Also, when does this event get fired?

HI, in my demo I use this way:

B4X:
Sub a_LocationResult(Result As String, Value As Boolean)
    If (Value) Then
        a.CityName = Result
        StartActivity(Forecast)
    End If
End Sub

P.S.
Can U please post the entire code also via e-mail:salvigiuseppe@libero.it so I can check it.
 

Laurent95

Active Member
Licensed User
Longtime User

Hi Giuseppe,

Thank you for update the library again.
I need some explains about the new functions.
1) If i don't use the FromLocation or FromLatAndLong, i don't need to use the callback for cancel the timer in my code, right ?
2) Other question about this two new functions, what they returns exactly ? Only the city or other data ? i bet you use the geoname api for this and in my widget i give the possibility to find a place on a map. Maybe the new function can help me to retrieve the exact place with lat & long for a city. But not sure, i need other data also, it's why i ask you what you get as data in this way.
Another, but related to the next post, how you, or we, can determine which ISO code is used for the website ?
On the Website they say :
But i don't see anywhere in functions how i can put a special ISO code.
I think it's good for the spelling in each language to search a city. It can help, for example Manila in English it's Manille in French.
And who knows maybe we can search a city with Walof spelling, soon when we have learned it

Thank you in advance for your help, the library works good and grows up time after time.

Best regards.
Laurent
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…