Share My Creation [Free] Weather App

Building a Weather App

1660312095137.png



One of my recent projects required me to build a weather app that would work with an API of my choice. This was my first introduction to working with a weather API, so I knew there was going to be a steep learning curve, but I was excited about the chance to finally get some practical application of B4A and build a working product.

After doing a little research and seeing some comments from other programmers, I decided to use the OpenWeatherMap API. Setting up an account was as easy as it could be and their free accounts allow up to 7,200 calls per day and limit calls per minute to 60. This obviously wouldn't be ideal for a high-traffic product.


Contact: [email protected]
Free Source code: LINK
 

Attachments

  • pack1.jpg
    pack1.jpg
    510.9 KB · Views: 2,363
  • esse.png
    esse.png
    131.3 KB · Views: 727
  • Screenshot_20211028-102211.png
    Screenshot_20211028-102211.png
    75 KB · Views: 729
  • Screenshot_20211028-104416.png
    Screenshot_20211028-104416.png
    87.7 KB · Views: 749
Last edited:
Thanks for sharing the source. Following error in log for missing library. Where I can download? Thanks.

[IDE message - 3:03:06]
The following libraries are missing:
slidingmenuwrapper
 

asales

Expert
Licensed User
Longtime User
Thanks for sharing the source. Following error in log for missing library. Where I can download? Thanks.

[IDE message - 3:03:06]
The following libraries are missing:
slidingmenuwrapper

See the first line!
 
Thanks for Library. Copy the library files in Extra library folder. I just opened source in B4A 11.50.
Compiled in release mode and Android 10 with B4A Bridge.
App installs but when open it crashes. Changed the mode to Debug and other but no success.
Is it some issue of slidingmenuwrapper library or something else... please help. I want to learn to make beautiful app. Thanks.
 

aeric

Expert
Licensed User
Longtime User
Thanks for Library. Copy the library files in Extra library folder. I just opened source in B4A 11.50.
Compiled in release mode and Android 10 with B4A Bridge.
App installs but when open it crashes. Changed the mode to Debug and other but no success.
Is it some issue of slidingmenuwrapper library or something else... please help. I want to learn to make beautiful app. Thanks.
What error you get?
I try to run in debug without problem.
 
Logger connected to: TECNO MOBILE LIMITED TECNO CH6h
--------- beginning of main
--------- beginning of system
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Copying updated assets files (284)
*** Service (starter) Create ***
** Service (starter) Start **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:25)
at wit.abdul.cadre.main._activity_create(main.java:436)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at anywheresoftware.b4a.shell.Shell$1.run(Shell.java:273)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewConfigurationCompat
... 20 more
--------- beginning of crash
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
at anywheresoftware.b4a.shell.Shell$1.run(Shell.java:276)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:25)
at wit.abdul.cadre.main._activity_create(main.java:436)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at anywheresoftware.b4a.shell.Shell$1.run(Shell.java:273)
... 7 more
Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewConfigurationCompat
... 20 more
 
Do you have AppCompat 4.00?
Yes I selected AppCompat 4.00 Library but it issue a warning in logs... "Library 'AppCompat' is not used. (warning #32)"

But after selecting I again test in Debug mode and the same situation as before... It took long time to load but just after partial first screen of App, it crashes.

Logger connected to: TECNO MOBILE LIMITED TECNO CH6h
--------- beginning of crash
--------- beginning of main
--------- beginning of system
Copying updated assets files (284)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/ViewConfigurationCompat;
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:181)
at anywheresoftware.b4a.objects.SlidingMenuWrapper.Initialize(SlidingMenuWrapper.java:25)
at wit.abdul.cadre.main._activity_create(main.java:436)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at wit.abdul.cadre.main.afterFirstLayout(main.java:105)
at wit.abdul.cadre.main.access$000(main.java:17)
at wit.abdul.cadre.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewConfigurationCompat
... 24 more
** Activity (main) Resume **
java.lang.RuntimeException: Unable to create service wit.abdul.cadre.httputils2service: java.lang.RuntimeException: java.net.SocketException: Connection reset
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4511)
at android.app.ActivityThread.access$1900(ActivityThread.java:268)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2082)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
Caused by: java.lang.RuntimeException: java.net.SocketException: Connection reset
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:175)
at wit.abdul.cadre.httputils2service.onCreate(httputils2service.java:48)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4499)
... 8 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:215)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:248)
at java.io.BufferedInputStream.read(BufferedInputStream.java:267)
at java.io.DataInputStream.readByte(DataInputStream.java:268)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:344)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
... 10 more
 

aeric

Expert
Licensed User
Longtime User
Yes I selected AppCompat 4.00 Library but it issue a warning in logs... "Library 'AppCompat' is not used. (warning #32)"

But after selecting I again test in Debug mode and the same situation as before... It took long time to load but just after partial first screen of App, it crashes.
Forget about AppCompat library.
I was testing on my emulator and it works without issue.
Then I tried compile to physical phone but it doesn’t work. I suspect the project file is corrupted so I recreated using a new project. After one or two attempts successful compilation the logger started to not work. I don’t know what is the problem. Is it my phone, B4A, network firewall? Now I stop playing with this example.

By the way, back to your question. I tried to replace the slidingmenu with B4XDrawer. You may try the same if that library gives you error.
 
Thanks so much for humble efforts. I also tried on Android 6 and 10 but same result.
You are right that it looks corrupted. Maybe B4XDrawer work or not, or Erel can dig in... Thanks.
 
Top