Android, Kotlin, Programming

HTTP GET using Volley

I was making an Android app using Android Studio (3.1.3) which sends a HTTP GET request. The code was very similar to this:

String serverURL = "";
URL url = new URL(serverURL);
HttpURLConnection connection = null;
try {
    connection = (HttpURLConnection) url.openConnection();
    BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
    //Do something with this InputStream
    // handle the response
    int status = connection.getResponseCode();
    // If response is not success
    if (status != 200) {
        throw new IOException("Post failed with error code " + status);
} catch (Exception e) {
} finally {
     if(connection != null)

The request was never sent. I tried everything but I just couldn’t make it work. However!

I found a solution using Volley ( This code is in Kotlin but as you can see it is very simple and mostly importantly it works!

val queue = Volley.newRequestQueue(this)
val url = ""
val stringRequest = StringRequest(Request.Method.GET, url, null, null)

Don’t forget to add these lines to the AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


Android, Tech

Galaxy Note 2 is the best!

I think that the Galaxy Note 2 is the best phone ever. I must say I was concerned about its large size but it’s actually just perfect. The screen is incredible!!! I was never able to watch any movies on my previous smaller phones, and I never understood how people could do that. I’ve been watching Chuck on my phone 🙂

Android, Tech

Can’t send an SMS on Android?

I recently flashed a new ROM on my Galaxy Nexus, which was Codename Sammy ( This ROM is awesome but for whatever reason I couldn’t send an SMS any more. After much trying I thought the ROM was crap so I decided to flash stock Jelly Bean. Guess what? SMS still didn’t work. The problem was that the SMSC number was lost during the flashing of Codename Sammy (no idea why). The SMSC (SMS Centre) number must be set to your local provider before you can send an SMS and here’s how you set it:

(FYI: These instructions work on the Galaxy Nexus GSM with Android 4.1 Jelly Bean)

  1. Go the dial screen
  2. Enter *#*#4636#*#* (in case those symbols are hard to see, asterisk hash asterisk hash 4636 hash asterisk hash asterisk)
  3. This will open the “Testing Screen” with four menu items (Phone Information, Battery Information, Usage Statistics, Wi-Fi Information)
  4. Touch on the menu item “Phone Information”, this opens another screen.
  5. Scroll to the bottom of this screen.
  6. You should see a blank SMSC field, along with the “Update” and “Refresh” buttons next to it.
  7. If you press Refresh and you see a number that starts with 0791 or 0891 then (more than likely) the SMSC number is correct and there’s another problem (sorry can’t help you there).
  8. If you press Refresh and you see “00” (zero zero) then the SMSC number is wrong.
  9. Find out your SMSC number from this (
  10. Now, you can’t just enter that number. It has to be converted to PDU format.
  11. Leave your phone as is and go to a computer.
  12. Go to
  13. Scroll to the bottom
  14. Enter your SMSC number in the SMSC field. (my SMSC number is +61411990001)
  15. Leave the Receiver field empty.
  16. Leave alphabet size as 7
  17. There’s another field below that, just leave it empty.
  18. Click the Convert button and on the right hand you should see something like this:


  19. The only numbers you need are shown in bold (16 digits), which are:


  20. Enter this number on your phone and click Update.
  21. Voila!

Now you should be able to send an SMS 🙂