Build an IFSC Bank Details App (Part 2) — Kotlin + Volley + JSON + Error Handling(Beginner Friendly)
Автор: Patel Akash
Загружено: 2025-10-02
Просмотров: 3
Описание:
Welcome back! In Part 2 we write the Kotlin code to make our app actually work. We read the IFSC from the input, validate it, show a Loading message, call the free IFSC API using Volley, parse the JSON safely, and display the bank details. We also handle errors in a friendly way, like invalid IFSC, no internet, timeout, and server problems. Everything is explained slowly in simple words, just like a student would teach a friend.
Chapters
0:00 Quick recap of Part 1
0:25 Open MainActivity.kt and connect to the XML
1:20 Find views and set up the Volley RequestQueue
2:10 IFSC validation (empty, length 11, uppercase)
3:10 Show Loading and disable the button
3:40 Make the GET request with Volley
5:00 Parse JSON with optString (safe reading)
6:00 Print details using the formatted string from strings.xml
6:45 Handle errors: invalid IFSC, server error, no internet, timeout
8:10 Re-enable the button and test again
9:00 Demo: valid IFSC, invalid IFSC, airplane mode
10:00 What to improve next and wrap-up
What you will learn
• How to connect Kotlin code to your XML screen using setContentView and findViewById
• How to read and clean text input, then validate it (simple checks first)
• How to use Volley to make a GET request to an API endpoint
• How to safely parse JSON fields with optString without crashing
• How to show user-friendly messages for different error situations
• How to keep the UI responsive by disabling and re-enabling the button
Files we edit
• app/src/main/java/your_package/MainActivity.kt
• app/src/main/res/values/strings.xml (using the formatted result string)
• app/src/main/AndroidManifest.xml (already has Internet permission and theme from Part 1)
Handy notes while you watch
• API endpoint format: https://ifsc.razorpay.com/IFSC_CODE
• Sample IFSCs to test: SBIN0000001, HDFC0000001
• Basic validation idea: not empty, exactly 11 characters, use uppercase
• Friendly error mapping:
404 means invalid IFSC
5xx means server problem
No connection and timeout mean internet or network delays
• Always re-enable the button after the request finishes
Troubleshooting (quick fixes)
• App opens but button does nothing: check your onClick code and IDs match the XML
• Crash on launch: use a safe theme in the Manifest and rebuild
• No internet in emulator: open Chrome inside the emulator and try google dot com; if it fails, toggle Airplane Mode, Cold Boot the AVD, or set DNS to 8.8.8.8
• JSON fields show N A: that is normal if the server did not send some fields; optString keeps the app safe
• Still stuck: read Logcat for the first red error line and fix that part
What’s next
Small upgrades to try after this video:
• Add a ProgressBar during Loading
• Add a Copy or Share button for the results
• Add a strict IFSC regex check
• Save the last IFSC using SharedPreferences
• Try Retrofit and ViewBinding for bigger projects
Support the channel
If this helped you, please like the video, drop your questions in the comments, and subscribe for more simple Android builds. Thanks for learning with me!
Hashtags
#Android #Kotlin #AndroidStudio #Volley #JSON #IFSC #Beginner #MobileApp #AppDevelopment #Programming #CodeNewbie #AndroidDevelopment #MaterialDesign #XMLLayout #Networking #HTTP #API #StudentProject #Tutorial #LearnToCode #DevCommunity #CodingJourney #AppDev #Gradle #Debugging #UIUX
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: