Syed Sayem blog

Udacity Android Courses

The sections below include all of Udacity’s Android-related courses, including their Android Basics & Android Developer Nanodegree material.

The complete course list is presently lacking a linear curriculum, so this reference aims to provide a clear, easy to follow path based on each course’s prerequisites. The course order in the “Full Curriculum” sections is structured so that inidividuals with no prior programming experience can work through them from start to finish.

All of the courses can be taken for free; although the paid Nanodegree programs do offer additional benefits, including:

  • a Google-accredited certificate of completion
  • code reviews & guidance by Google-certified instructors
  • access to a course support forum
  • guaranteed job eligibility (Nanodegree Plus)

Full Curriculum

Level Group Course Length Projects
Beginner Preparation Java Ⅰ 6 Weeks  
Beginner Preparation Java Ⅱ 4 Months  
Beginner Preparation Git & GitHub 3 Weeks Contribute to a Repository
Beginner Preparation Install Android Studio 1 Day  
Beginner Core App Development Ⅰ 4 Weeks Score Tracker, Fact List, Quiz, Music Player, Business Info
Beginner Core UI Design 4 Weeks Build Your Own App
Beginner Core Multi-Screen Apps 8 Weeks Report Card, Tour Guide
Beginner Core Networking 5 Weeks Book List, News Reader
Beginner Core UX Design 6 Weeks Build a User-Targeted App
Intermediate Core App Development Ⅱ 2 Weeks Popular Movies, Weather, Build Your Own App
Intermediate Core Material Design 4 Weeks Apply Material Design to News Reader
Intermediate Services Sign-In & Profiles 2 Weeks  
Intermediate Services Maps 2 Weeks  
Intermediate Services Location & Context 2 Weeks  
Intermediate Services Analytics 2 Weeks  
Intermediate Services Ads 2 Weeks  
Intermediate Games Game Design Ⅰ 8 Weeks Breakout Clone
Intermediate Games Game Design Ⅱ 8 Weeks Space Shooter
Advanced Core App Development Ⅲ 6 Weeks Stock Tracker
Advanced Core Optimizing App Performance 4 Weeks  
Advanced Core Firebase 8 Weeks  
Advanced Core Gradle 6 Weeks Joke Teller
Advanced Platforms Android TV & Google Cast 1 Week  
Advanced Platforms Android Wear 2 Weeks Create Wear Interface for Weather App
Advanced Platforms Android Auto 1 Week  

 

* Course lengths are based on Udacity’s presumed allocation of 6 hours per week.


Nanodegree Outlines

Android Basics

Skill Level:

  • Entering students should be motivated to learn and be comfortable with basic computer skills like managing files, navigating the Internet and running programs.

Curriculum:

Also, there are currently Habit Tracker & Inventory Tracker projects listed with the message: “Supporting course content coming in August!”.


Android Developer

Skill Level:

  • Entering students are expected to have prior experience building applications (web or mobile)
  • You should have at least 1-2 years of experience in Java or another object-oriented programming language prior to enrolling.

Curriculum:
        App Development Ⅱ
        App Development Ⅲ
        Gradle
        Material Design
        Android Wear


Learning with Treehouse

Treehouse is my code learning platform of choice. There are other online training solutions available like Pluralsight, Infinite Skills, Codecademy and Lynda.com, but I liked Treehouse better because their gamification keeps me motivated to learn more. You earn more points and achievements the further along you go.

My Treehouse profile first-screenshot

Treehouse has a nice UI and slight gamification which lets you score points in different skill sets and collect achievement badges.

second-screenshot

Overall, I highly recommend Treehouse. They’ve been a huge help for me, the courses are enjoyable.

Microservice testing

Microservice are hot buzz words in the development community right now. There are quite a lot of learning materials of microservices, but there are very few resources on how to test microservices. My company is in the process implementing ‘microservices’, and I’ve been asked to build a test automation framework to test microservice.

In this post, I’ll demonstrate how to write a basic hello server and hello client to test microservices.

first-screenshot

  1. Create a maven project
  2. Add the following dependency to your pom.xml:
    <dependencyManagement>

        <dependencies>
            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-jdk14</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.1.2</version>
            </dependency>
            <!-- No commons logging -->
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons-logging.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!-- Protobuf -->
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.version}</version>
            </dependency>

            <!-- GRPC -->
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-core</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-okhttp</artifactId>
                <version>${grpc.version}</version>
            </dependency>

            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>protoc-gen-grpc-java</artifactId>
                <version>${grpc.version}</version>
            </dependency>

            <!-- Test scope -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.9.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

Create a hello.proto

syntax = "proto3";

package sayem.hello;

option java_package = "org.sayem.hello";

option java_outer_classname = "HelloModel";

//
// Request / Response
//

message GreetingRequest {
    string name = 1;
}

message GreetingReply {
    string greeting = 2;
}

//
// Service
//

service HelloService {
    rpc GetGreeting (GreetingRequest) returns (GreetingReply) {
    }
}

Create a HelloClient Module

public final class HelloClient {

    private final Logger log = LoggerFactory.getLogger(getClass());
    private final ManagedChannel channel;
    private final HelloServiceGrpc.HelloServiceBlockingClient blockingStub;

    /**
     * Construct client connecting to HelloWorld server at {@code host:port}.
     */
    public HelloClient(String host, int port) {
        channel = ManagedChannelBuilder.forAddress(host, port)
                .usePlaintext(true) // - for debug only
                .build();
        blockingStub = HelloServiceGrpc.newBlockingStub(channel);
    }

    public static void main(String[] args) throws InterruptedException {
        HelloClient client = new HelloClient("localhost", 8081);
        try {
      /* Access a service running on the local machine on port 50051 */
            String user = "world";
            if (args.length > 0) {
                user = args[0]; /* Use the arg as the name to greet if provided */
            }
            client.greet(user);

            String user2 = "GRPC client";
            if (args.length > 1) {
                user2 = args[1]; /* Use the arg as the name to greet if provided */
            }
            client.greet(user2);
        } finally {
            client.shutdown();
        }
    }

    public void shutdown() throws InterruptedException {
        channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
    }

    /**
     * Say hello to server.
     */
    public void greet(String name) {
        log.info("Will try to greet {} ...", name);
        HelloModel.GreetingRequest request = HelloModel.GreetingRequest.newBuilder()
                .setName(name)
                .build();
        HelloModel.GreetingReply response;
        try {
            response = blockingStub.getGreeting(request);
        } catch (StatusRuntimeException e) {
            log.warn("RPC failed: {}", e.getStatus());
            return;
        }
        log.info("Greeting: {}", response.getGreeting());
    }
}

Now, create a client module

public final class HelloClient {

    private final Logger log = LoggerFactory.getLogger(getClass());
    private final ManagedChannel channel;
    private final HelloServiceGrpc.HelloServiceBlockingClient blockingStub;

    /**
     * Construct client connecting to HelloWorld server at {@code host:port}.
     */
    public HelloClient(String host, int port) {
        channel = ManagedChannelBuilder.forAddress(host, port)
                .usePlaintext(true) // - for debug only
                .build();
        blockingStub = HelloServiceGrpc.newBlockingStub(channel);
    }

    public static void main(String[] args) throws InterruptedException {
        HelloClient client = new HelloClient("localhost", 8081);
        try {
      /* Access a service running on the local machine on port 50051 */
            String user = "world";
            if (args.length > 0) {
                user = args[0]; /* Use the arg as the name to greet if provided */
            }
            client.greet(user);

            String user2 = "GRPC client";
            if (args.length > 1) {
                user2 = args[1]; /* Use the arg as the name to greet if provided */
            }
            client.greet(user2);
        } finally {
            client.shutdown();
        }
    }

    public void shutdown() throws InterruptedException {
        channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
    }

    /**
     * Say hello to server.
     */
    public void greet(String name) {
        log.info("Will try to greet {} ...", name);
        HelloModel.GreetingRequest request = HelloModel.GreetingRequest.newBuilder()
                .setName(name)
                .build();
        HelloModel.GreetingReply response;
        try {
            response = blockingStub.getGreeting(request);
        } catch (StatusRuntimeException e) {
            log.warn("RPC failed: {}", e.getStatus());
            return;
        }
        log.info("Greeting: {}", response.getGreeting());
    }
}

You can see the full source code in this repository

Setup printer in Arch Linux

Recently I wrote a guide on how to setup Arch Linux on your PC. Today I am going to show you how to setup printer in Arch Linux.

In order to get printing working in Arch Linux, you have to install the following libraries:

$ yaourt -S libcups
$ pacman -S cups cups-filters ghostscript gsfonts

Now, Install printer driver

I have a Brother HL-2270DW series. So, I am going to install Brother HL-2270DW driver. You can search for printer driver in Aur Package

$ yaourt -S brother-hl2270dw

Enable cups so it starts with system boot

$ systemctl enable org.cups.cupsd.service
$ systemctl daemon-reload

Start CUPS

$ systemctl start org.cups.cupsd.service

Open the CUPS interface from this URL (http://localhost:631/admin) and log in as root. Here you can add and configure your printer.

Audiobook

Over the last few months, I have increasingly been buying and downloading audiobook from audible.com and listen to them on my commute to and from work, here are some books I think worth reading.

Developer

Self-Help

Fiction