Home / Technology

How to Learn to Code With a Phone and Limited Data

Measured download sizes for an offline Python setup on Android (about 49.5 MB with the GitHub build), a tested 20-line quiz program, and what a phone can and cannot do.

Cyril Bongnyu Founder and editor

You will be told you need a laptop to learn programming. It is genuinely easier with one. It is not required, and treating it as required is how a lot of people who would have been good at this never start.

You can learn to write real code on an Android phone, offline, for months, before a computer becomes the limiting factor. What you cannot do is skip the part where you write code yourself, and that is the part a phone handles fine.

This guide covers what works on a phone, what does not, and the point at which you will need something bigger.

What a phone does well and badly

Works on a phoneNeeds a computer eventually
Learning syntax and logicLarge projects across many files
Solving programming exercisesProfessional development tooling
Writing and running small programsRunning heavy processes locally
Reading documentation and codeSerious debugging on a small screen
Understanding algorithmsMost paid work, day to day
Building your first useful scriptsTeam workflows

The left column covers the beginner stage and part of the intermediate one. The right column matters when you are working professionally, and by then a computer is an investment you make with earnings rather than a barrier to starting.

Start with Python

Not because it is fashionable, but because it suits these constraints specifically.

Python has an interactive mode where you type a statement and see the result straight away, and it groups statements by indentation, so there are no braces to hunt for, which should mean fewer bracket characters to find on a phone keyboard. Programs are short, so a screen holds a useful amount at once. And it runs well in the small offline environments available on Android.

It also happens to be widely used in real work, so nothing you learn is wasted effort towards a toy.

Avoid starting with anything that requires a large toolchain, a compiler you must install, or a heavy editor. Those are reasonable languages and they are the wrong first choice from a phone.

Get something that runs code offline

This is the one setup decision that matters, and it separates learning from reading about learning.

You need an app that actually executes Python on the device, with no connection. Termux, a terminal app, installs Python as a local package (sizes are measured below), so it runs without a connection once installed (installing extra pip packages needs a connection). Whatever you choose, test it the same way: install it, turn data off entirely, and try to run a program. An app that sends your code to a server to run it is useless the moment your bundle finishes.

Alongside it, download documentation you can read offline, and a set of exercises. Do this in one connected session and you have weeks of work available.

Avoid tools that only run in a browser tab. They are excellent with connection and worth nothing without it.

The typing problem, which is real

Code uses brackets, colons, quotes and underscores heavily, and phone keyboards bury most of them two taps deep. This is the genuine friction, and it is worth attacking directly rather than enduring.

  • Install a keyboard with a symbol row. Several free ones put brackets and punctuation on the main layer.
  • Turn off autocorrect and autocapitalise in your coding app. They will silently corrupt code, and the resulting errors are maddening to find.
  • Use the app’s snippets if it has them, for anything you type repeatedly.
  • Consider a cheap wired or bluetooth keyboard if you can. Attached to a phone it turns the experience into something close to a small computer, for a fraction of the cost of one.

Accept that you will type more slowly than someone on a laptop. Typing speed is not what makes a programmer, and thinking clearly about a problem before writing is worth more than fast fingers. If anything, the slowness pushes you towards planning code before typing it, which is a good habit.

The learning loop that works

The failure mode here is identical to the one in exam revision: consuming material feels productive and teaches very little.

Watching a tutorial and following along produces the pleasant sensation of understanding, and then you cannot write the same thing from a blank screen an hour later. It is the same fluency illusion described in our twelve week revision plan, and the answer is the same: produce before you check.

  1. Read a short explanation of one concept. One, not a chapter.
  2. Close it and write something using it, from memory, however badly.
  3. Run it. It will fail. That is the normal state of programming.
  4. Fix it yourself first. Read the error message properly before looking anything up. Error messages are instructions, and beginners skip past them.
  5. Only then look it up, and add whatever you got wrong to your cards.

Cards work for programming exactly as they do for any subject. What does this error mean? What is the syntax for this loop? Review them on a schedule and syntax stops being the thing slowing you down.

Build things that are actually useful to you

Exercises teach syntax. Projects teach programming, and they are what you will eventually show people.

Choose small things you would genuinely use. A program that works out your revision schedule from a list of topics. Something that tracks your data spending. A tool that converts your marks into percentages. A quiz program that questions you from a file of your own cards.

That last one is a genuinely good first project, because it is useful, small enough to finish, and it makes you handle files and loops and input, which is most of the beginner curriculum in one place.

Finish things. An unfinished project teaches you the easy half and skips the part where you make it actually work, which is where the learning concentrates.

What it costs in megabytes to start, measured

The claim that a phone is enough only means something if the setup fits a small bundle. Download sizes for a real offline route were measured on 18 October 2026: the terminal app Termux, the Python package it installs, and the official Python documentation for offline reading. File sizes come from the servers’ own size headers and package indexes, not from a phone test.

ItemBytesMegabytes (decimal)Where measured
Termux app, v0.118.3, arm64-v8a APK (GitHub debug build)35,106,60735.1GitHub releases API (published 22 May 2025)
Python 3.14.6 package plus its 16 dependencies10,014,99210.0Termux main repository index (aarch64), dependencies summed
Python 3.13 documentation, plain text (zip)4,372,0744.4docs.python.org downloads
Python 3.13 documentation, EPUB8,717,0408.7same
Python 3.13 documentation, HTML (zip)12,102,08212.1same
Python 3.13 documentation, PDF A4 (zip)20,792,84720.8same

Worked arithmetic. App + Python + text documentation = 35,106,607 + 10,014,992 + 4,372,074 = 49,493,673 bytes, about 49.5 MB. Some of Python’s dependencies may already be in a fresh Termux install, so this is an upper bound. One published price puts 1 GB of mobile data in Cameroon at US$1.63 (a comparison, data year 2023 per the site’s data files, by Cable/BestBroadbandDeals, a commercial compiler rather than a regulator, so treat it as indicative). 49.5 MB is 0.0495 GB, and 0.0495 x 1.63 = about US$0.08. Swapping the text documentation for the HTML version raises the total to 57.2 MB, about US$0.09. The setup is cheap; the time you spend practising is the real cost.

This is the GitHub arm64 build. The F-Droid build is a universal APK of 113.9 MB (measured 18 October 2026), which makes the same set-up about 128.3 MB (113,880,067 + 10,014,992 + 4,372,074 = 128,267,133 bytes), roughly US$0.21 at US$1.63 per GB.

Two cautions from the Termux project page. It lists three sources (F-Droid, GitHub, Google Play), says their APKs are signed with different keys and must not be mixed, and describes the Google Play build as experimental with missing functionality. It also says full support is for Android 7 and above. Check both before you download.

A 20-line first project, run. The quiz program mentioned above is below. This exact file was run on 18 October 2026 on a Windows PC with Python 3.13.3 (not on a phone). With a three-line cards.txt (Square root of 144|12, Formula for water|H2O, Capital of Cameroon|Yaounde) and the questions asked in that order, typing 13, H2O and Yaounde printed Answer: 12, Correct, Correct and 2 out of 3. Because of random.shuffle the order of questions changes on every run, so type each answer against the question actually shown.

import random

cards = {}
with open("cards.txt") as f:
    for line in f:
        question, answer = line.strip().split("|")
        cards[question] = answer

score = 0
questions = list(cards)
random.shuffle(questions)
for question in questions:
    reply = input(question + " ")
    if reply.strip().lower() == cards[question].lower():
        print("Correct")
        score += 1
    else:
        print("Answer:", cards[question])

print(score, "out of", len(cards))

It uses a file, a dictionary, a loop, input and a condition, which is most of what the beginner tutorials cover. Python groups statements by indentation (the Python tutorial: “indentation is Python’s way of grouping statements”), so there are no braces to hunt for, which should mean fewer bracket characters on a phone keyboard; the file still needs colons, quotes and brackets, which is why the keyboard advice above matters.

Batch your connected time

Programming invites constant searching, and constant searching is expensive when data is metered.

Keep a written list of things to look up, exactly as you would for revision, and clear it in one session. Download documentation rather than reading it online. Save answers you found useful into a file of your own, so the second time you hit the same problem you are reading your own notes rather than searching again.

That personal file becomes valuable quickly. Most programming problems you face are ones you have faced before and forgotten.

The wider method for working with unreliable connection is in revising without reliable electricity or data, and it applies here almost unchanged.

When you genuinely need a computer

Be honest about this rather than pretending a phone does everything.

You will want one when projects grow past a few files, when you need to run several things at once, and when you start applying for work, because the tools employers expect are desktop tools. Web development in particular becomes awkward on a phone sooner than general programming does.

The useful reframing is that the computer is a later purchase rather than an entry requirement. Months of phone learning takes you to the point where a modest secondhand machine is enough, and by then you know what you actually need it to do.

Meanwhile, look for access rather than ownership. School and university computer rooms, a library, a cyber café for one focused session a week. An hour on a real machine goes a long way when the learning happened elsewhere.

What this can lead to

Phone based learning will not get you hired on its own. What it does is take you through the early stage at almost no cost, so that when you do reach a computer you are months ahead rather than starting.

What actually gets people hired is finished work someone can look at, evidence you can solve a problem you were not given the answer to, and persistence. None of those require expensive equipment to begin building.

Questions people ask

Should I learn on an iPhone?

More restricted. Apple’s App Store Review Guideline 2.5.2 says apps may not download, install or execute code that changes their features, with a limited exception for educational apps that teach code or let students test it. No iPhone coding app was tested for this post. Termux can be installed on Android directly from F-Droid or GitHub, so if you have a choice, use the Android device.

Are paid courses worth it?

Not at the start. Free material for beginner programming is abundant and good, and the limiting factor is never material, it is how much code you write yourself. Spend money on a keyboard or a power bank before spending it on a course.

How long before I can build something real?

It depends on the hours you put in, and no measured figure is available. A small program like the 20-line quiz above is a realistic first target; a fair test of your pace is whether you can write it from a blank screen.

Is it too late if I am already in university?

No. People start at every age and the field cares far more about what you can do than when you began. Consistency over months beats an early start followed by stopping.

This week

Install something that runs Python offline, and test it with data turned off. Install a keyboard with a symbol row. Then write a program that prints your name, and one that adds two numbers you type in.

That is a complete first session.

More in Tech for Africa, and on which paths need which qualifications in careers and subject requirements.