B4A Library ICOSWorldForecast 3.50

lonleystar

Well-Known Member
Licensed User
Longtime User
hi mkvidyashankar, Thanks for report this bug, i´ll fix soon.


best regard

G.Salvi
 

Paulsche

Well-Known Member
Licensed User
Longtime User
incompatible with Android 2.2 ?

Hello,

it may be that the library is not compatible with Android 2.2?
I got feedback from users where the app is no longer running since I've installed the new library. The emulator with version 2.2 it does not work anymore.
Android > 2.2 the APP runs without problems.

B4X:
VFY: dead code 0x021f-0394 in Ledsmith/calendar/Calendar;.ListofEventsWithDescKeywordBetweenDates (ILjava/lang/String;JJ)Lanywheresoftware/b4a/objects/collections/List;
VFY: unable to resolve static field 955 (CONTENT_URI) in Landroid/provider/CalendarContract$Instances;
VFY: replacing opcode 0x62 at 0x021e
VFY: dead code 0x0220-0395 in Ledsmith/calendar/Calendar;.ListofEventsWithTitleKeywordBetweenDates (ILjava/lang/String;JJ)Lanywheresoftware/b4a/objects/collections/List;
** Activity (main) Create, isFirst = true **


Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x4001d800)
main_activity_create (java line: 1031)
java.lang.NoClassDefFoundError: android.os.StrictMode$ThreadPolicy$Builder


   at com.giuseppe.salvi.icos.library.weather.ICOSWorldForecastWrapper.Initialize(ICOSWorldForecastWrapper.java:71)
   at HBVerbrauchszaehler.full.main._activity_create(main.java:1031)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165)
   at HBVerbrauchszaehler.full.main.afterFirstLayout(main.java:84)
   at HBVerbrauchszaehler.full.main.access$100(main.java:16)
   at HBVerbrauchszaehler.full.main$WaitForLayout.run(main.java:72)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:4627)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
   at dalvik.system.NativeStart.main(Native Method)
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.os.StrictMode$ThreadPolicy$Builder
   at com.giuseppe.salvi.icos.library.weather.ICOSWorldForecastWrapper.Initialize(ICOSWorldForecastWrapper.java:71)
   at HBVerbrauchszaehler.full.main._activity_create(main.java:1031)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165)
   at HBVerbrauchszaehler.full.main.afterFirstLayout(main.java:84)
   at HBVerbrauchszaehler.full.main.access$100(main.java:16)
   at HBVerbrauchszaehler.full.main$WaitForLayout.run(main.java:72)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:4627)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
   at dalvik.system.NativeStart.main(Native Method)
  Force finishing activity HBVerbrauchszaehler.full/.main
Activity pause timeout for HistoryRecord{480e69a0 HBVerbrauchszaehler.full/.main}


Sending signal. PID: 338 SIG: 9


Process HBVerbrauchszaehler.full (pid 338) has died.


WIN DEATH: Window{48293ad0 HBVerbrauchszaehler.full/HBVerbrauchszaehler.full.main paused=false}
Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@48054e50


GC_EXPLICIT freed 721 objects / 53384 bytes in 436ms
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi Paulsche, the library is compatible with Android 2.2, i fixed and upload the new version.

just download it again and enjoy any bug please report.


best regard

G.Salvi
 

lonleystar

Well-Known Member
Licensed User
Longtime User
hi mkvidyashankar, Thanks for report this bug, i´ll fix soon.


best regard

G.Salvi
hi mkvidyashankar, now when you use the getlist method you'll have more cities on the list
and fixed the problem you had before.

Download again the library end dont forget to rename from .zip to .rar

please report any bugs.

best regard

G.Salvi
 

Paulsche

Well-Known Member
Licensed User
Longtime User
Hello,
thanks for the quick update, my problem is unfortunately still persists,
with the Library runs the app not on Android 2.2 , with 2.3 it runs without problems.
I'm perplexed :sign0013:
 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hello,
thanks for the quick update, my problem is unfortunately still persists,
with the Library runs the app not on Android 2.2 , with 2.3 it runs without problems.
I'm perplexed :sign0013:
Hi Paulshe, yesterday I installed android 2.2 on my tab and it worked without problem, but now when I come from German school I´ll check it again.

Kind regards.
Herzliche Grüße.
cordiali saluti.

G.Salvi
 

grant1842

Active Member
Licensed User
Longtime User
This lib does not work on my emulator 2.2 . Will it work on a actual device with 2.2 on it .
Thanks for your hard work great LIB.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
This lib does not work on my emulator 2.2 . Will it work on a actual device with 2.2 on it .
Thanks for your hard work great LIB.
Hi grant1842, on the emulator i dont know, because i use the real device, anyway it work fantastic on real device.

best regard

G.Salvi
 

grant1842

Active Member
Licensed User
Longtime User
Widget service problem.

I am trying your lib in the Widget example Erel posted.
I get weird force close problem .
B4X:
Sub gettemp

    Dim w As ICOSWorldForecast
    Dim s As String
    w.Initialize("w")
    w.ApiKey="111111111111111111111"
    s= w.GetList("wise ","Search Results",False)
    w.CityName= s
    rv.SetText("Label1",s)
    Log(s)

Logcat
widgetservice_gettemp (java line: 159)
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

Erel commented
"Seems like this library requires an activity context"
I do not know what this is.

Thanks for you work , but can you help me figure out this problem.
 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi grant1842, I understand give me some time, and it will work as a widget. I'm sure till tomorrow afternoon you will enjoy the library.

best regard

G.Salvi
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hey thanks for your support
Hi grant1842, as I promised you i fixed library.
The changing is only GetList method.
Now you should use the ListView from the basic to get the list of all cities.
Take a look at the demo and Attached Thumbnails.

Download again the Library and dont forget to rename from .zip to .rar

**************************************************************

This is the Widget Demo.

Sub Process_Globals
Dim a As ICOSWorldForecast
Dim str As String
Dim rv As RemoteViews
Dim mGetList As String
End Sub
Sub Service_Create
a.Initialize("a")
a.ApiKey="4aa3418d0a204342110904"
str="Milan"
a.CityName=str
rv = ConfigureHomeWidget("L1", "rv", 30, "ICOSForecastWeater")
End Sub

Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub

Sub rv_RequestUpdate
SetTime
rv.UpdateWidget
End Sub

Sub rv_Disabled
StopService("")
End Sub

Sub Service_Destroy
End Sub

Sub SetTime
rv.SetImage("img",a.CCIcon)
rv.SetText("lb1", a.CCTempCelsius&"°")
rv.SetText("lb2", str)
End Sub
 

grant1842

Active Member
Licensed User
Longtime User
Thanks so much for your support I'm at work but I will try this later when I get home
 

grant1842

Active Member
Licensed User
Longtime User
I had to delete the old files in the LIB folder and put new then Refresh lib and it works.
 
Last edited:

grant1842

Active Member
Licensed User
Longtime User
I liked your old way of getlist.(a.GetList("Los Angeles","Any Title",True))

My problem now is the widget layout will not support listviews to load up the get list.

Do you know a way to load the getlist like the old way so it just pops up and can choose from the getlist items.

I do not want to load a new activity and take up the whole screen just to choose a city, this is just a widget.

Do you know a way to load the getlist like the old way so it just pops up and can choose from the getlist items.

Thanks for your help
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi grant1842, the reason why did not work with the widget was just that. the old GetList. But don't worry as soon as I have some time I will find the solution to integrate again the old GetList and use it also with Widget.

I don't have much time now, because I moved to Germany, and I'm going to school to learn German well. But I promise you, I will find the solution for that

best regard

G.Salvi
 

walterf25

Expert
Licensed User
Longtime User
5 day forecast

Hi there LonelyStar, first of all let me thank you for this amazing library, i'm very happy that i came across B4A the software is amazing and the community is awesome.
However I just noticed something when trying to get a 5 day forecast, everything seems to be working perfect except for the day of the week not matching the date being retrieved.

here's my code to retrieve the 5 days!
B4X:
day1.text = ics.Short5DayName(0)&CRLF&ics.FCDate(0)
day2.text = ics.Short5DayName(1)&CRLF&ics.FCDate(1)
day3.text = ics.Short5DayName(2)&CRLF&ics.FCDate(2)
day4.text = ics.Short5DayName(3)&CRLF&ics.FCDate(3)
day5.text = ics.Short5DayName(4)&CRLF&ics.FCDate(4)

and here's an screen shot where it shows the days starting from Monday to Friday along with the dates, if you notice today is Wednesday so Dec 05 should be right below Wednesday.



Is it something i'm doing wrong or is it a problem with the library not matching the days to the dates?

Thanks!
:sign0098:
 

mkvidyashankar

Active Member
Licensed User
Longtime User
error persists



I tried with the new version, but getting the same error.
It works fine for other places.
 

MikeH

Well-Known Member
Licensed User
Longtime User
I`m trying to use your library with Android 2.2 tablet but getting force close error immediately. When using with 4.1 emulator it works fine.

Will this work with 2.2?

Thank you.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…