Skiffle : Android App To Discover, Search and Explore Music – The Making

This is just a log of contemplate on the challenges and learning I encountered while creating Skiffle : Discover tracks, albums and artists.

Skiffle on GitHub

Skiffle was designed with one simple motive , provide fastest way to search for music powered by the best source available. It uses Spotify API as backend.

How this log is structured?

The log is structured under headings. Each heading represents a certain facet of project or technology. Under each heading is the list of challenges or solution.

Overview : 

Skiffle is an app to provide the fastest way to search for music. Powered by Spotify API, it is a great little tool to keep track of your favourite artists and tracks.

While creating it I had some clear motives:

  1. Use RxJava
  2. Use dependency Injection
  3. Use Http Request Caching
  4. Follow Clean Architecture

Thus at some places it might seem as if the implementation is an overkill, but that was the main motivation behind creating  the app.

Software Engineering Items : 

  1. Reading Software Engineering Stackexchange  : It is a goldmine of knowledge for SE related principles like architecture and coding styles.
  2. Start creating your app from the data layer : Model the data layer first. Build your app from the data layer and then upwards. It would have saved me a ton of extra work.
  3. Very important to keep the naming conventions and interface consistent :
    It can get confusing other wise. Keep the naming strategy of everything consistent.
    Ex. AlbumList module, getAlbumList() as getter.
  4. Making sure that the names follow a conceptual model :
    ex. A recycler view showing a list of AlbumItem s.
    It uses a callback for click named onAlbumItemClicked().
    Though this is a small thing but gives a great peace of mind when coding and you expect the interface methods to be likle this.
  5. Local Variables are a bliss :
    Use variables in the smallest scope possible.
    This will allow garbage collector to reclaim objects faster and will save your from debugging nightmares.
  6. Think about all the edge cases before you go coding :
    Once you start coding your brain tricks you into being lazy.
  7. Writing effective git commit message :
    Here you can find useful list of emojis for commit messages
    https://gist.github.com/jhermann/0206ed09b3bbcefdd691

RxJava Items : 

As they say,

With a hammer in hand, everything looks like a nail.

Same goes when you use RxJava. You want to use it for everything. It’s more fun that way! 😀

1. Using for background thread offloading : 

The most trivial use of RxJava is to have it manage threads for you. I have used it extensively to offload tasks to background threads.

2. Observable.fromCallable() for simple usages : 

I wanted to use RxJava to offload the database reading and writing to a separate thread. For this I have used Observable.fromCallable. According to the docs it said that .create() is for advanced usage. That’s why I went with this approach.

3. RxJava 2.xx doesn’t allow nulls to be stream elements : 

You can’t emit null elements in the stream. I used pseudo objects that represent null elements as a work around.

4. Never leave the onError() method empty :

Always put a log statement in the onError method to get the error message

OkHttp Caching Items :

1. Using interceptors : 

Logging interceptors are handy to monitor requests your app is making.

Caching interceptors allows adding request caching.

Dependency Injection Items :

1. Inject or not to inject, that is the question?

For instance I decided not to inject Picasso instance as it already manages a singleton internally.

2. Using Qualifiers to inject multiple instances of same type : 

I used @Qualifiers to inject multiple instances of same type. An use case I encountered was to inject two WebService clients.

3. Regarding Singleton Scope : 

I found somewhere that dont use the @Singleton scope. Instead of that create your own custom application scope. It gives the scoping more clarity.

MVP Items :

1. Be ready for a class explosion : 

One thing i noticed is that, when you try to implement MVP or clean architecture in general, what you get is a class explosion. This is necessarily not a bad thing. Heard this in a fragmented podcast clean architecture episode.

2. How to deal with MVP when using view pager?

I ended up using fragments as views. Activity interacts with the presenter and just updates the fragments as required. And also receives callbacks from fragment events and forwards them to presenter. 

Android Items :

1. Use of onAttach() in fragments : 

It is used to check the state of the container. Example when fragment is using the activity as the container then onAttach() can be used to set the communicator listener.

2. Preventing multiple button clicks when favourite button was clicked for a track :

I disabled it when clicked instantly, then on onNext() and onCompleted() enabled it.

3. Creating SearchView is real pain in some part of anatomy  :

I found that support search view and search view are having different behaviours. I ended up using support search view as it was more like it.
In future, and production apps, best approach i think would be to create your own custom search view that caters to all your needs.

4. Search suggestions using provider :

Use fully qualified name if using packages. Which you should be using, for search activity names that you specify in android manifest.

5. Issue with showing data in fragments when it arrives asynchronously : 

Some times fragment was not finished inflating the views and binding when data was finished with loading. To deal with this I used callbacks and loading data completely before I set view pager.
When fragments finished inflating, they give a callback to the activity to give them the data. And as we have already loaded the data, it should not be a problem.

6. Use StringBuilder instead of String when strings have to be altered  : 

String is immutable and each alteration creates new objects.

7. The monster called as state management :

Managing life cycle of fragments and activities is real pain in the ass. They are very non deterministic.
I, almost towards the completion of the development found crashes due to state issues.
To test apps, enable the don’t keep activities option in development options.

Conclusion :

Main motivation was to create something useful and learn in the process.

Best way to learn alchemy is to go and try – “The Alchemist”

In fact, follows for learning anything.

You can find the project on GitHub :

Skiffle on GitHub

E-Summit ’17 IIT Bombay — Experience

E-Summit is the flagship entrepreneurship event organized by IITB. The two-day annual summit promises to be an amazing meeting ground for industry experts, business leaders, investors and entrepreneurs and of course, students, many of whom are aspiring entrepreneurs.

I attended this event in its 2017 edition and had mixed feelings on how the whole thing turned out holistically. There were some good parts and some not so good parts, but as a whole the event was worth attending.

There were many small talks spread on a 2 day course. Obviously, you can not attend all the talks, you have to select few of them according to the schedule and feasibility.

I personally realized that choose a topic that you are not familiar with as talks are pretty basic and don’t go to great depths.

Following are the talks and keynotes that I attended.

Day 1 :

  1. Keynote by Raj Jaswa :

First event of day 1 was keynote by Raj Jaswa. Most prominent thing he said in a nutshell was areas in which one should look for business opportunities.

Some being,

  1. Cloning and localisation
  2. Long tail business
  3. Adapt an existing business model to a new sector.

2. Digital Marketing :

This talk was presented by founder of E2M, a digital media company. I found this talk too basic aa I had already taken a course online on digital marketing.

Some topics discussed were,

  1. SEO
  2. PPC
  3. Social Media
  4. Emergence of mobile platforms

3. Brembo Company Presentation :

Brembo is a breaking technology company and a dominant force in the market. A manager from Italy presented the company’s operations in India.

He quoted a quote from the founder of Brembo that I found very captivating,

“Anyone can do simple things, but only few can handle difficult ones. We have to do difficult ones”.

4. Chat with Rahul Yadav :

Next session I attended was a Q&A session with Rahul Yadav, the founder of Housing.com.

It was nice to see him talking about his mistakes and telling people not to repeat them.

5. Wealth creating through financial planning :

This was conducted by Reliance Mutual Funds. In a nutshell it was all about SIP.

6. Keynote by Rajat Sharma :

The day ended by keynote by Rajat Sharma. He discussed his journey and his humility and wisdom was notable and inspiring.

7. Stand up comedy by Vipul Goyal and Sapan Verma

Nice performances by both of them always.

Day 2 :

Day 2 of the event was more power packed. I found the speakers and the talk topics, both to of higher level.

  1. Building a brand that indians love :

This was presented by an ISB professor. Basic point conveyed in the talk was that business customers have two currencies that they spend : time and money.

Thus, trigger point of all the businesses must be how customers are spending these two.

2. Protecting your brand : Trademarks, Copyrights and Patents :

I had no prior knowledge of patents and thus decided to attend this talk.

It nicely packed info on what, when and where to file the patent.

3. Startup Scaling : Overcoming key operational challenges :

Pressing issue of this talk was the resource visibility issues that startups face.

The speaker was from a company called OutThink LLC. They advocated that such challenges can be overcame by businesses collaborating and providing services to each other instead of doing things completely by themselves in isolation.

Here is where OutThink helps its customers by what they call at SRM : Strategic Resource Mapping.

4. Most Common Startup Budget Mistakes:

This talk was presented by a startup investor and mentor from Ireland.

The talk revolved around funding sources, funding advice and bootstrapping.

5. Final Keynote : By Bibop Gresta : COO Hyperlopp TT

The most exciting event of the summit was final keynote by COO of Hyperloop. He presented us with the overview of Hyperloop and how it is planning to carry its operations in India.

It was notable how fit and fun he was at the age of 40. Something that we can all learn from.

Conclusion :

To conclude, the summit was a thumbs up. It was not entirely the standard that I was expecting it to be, but still was Ok.

It was great if you have networking as the primary goal in your mind, not so good if you wanted hand on knowledge on topics.

Finally, it was nice to see other aspiring and existing entrepreneur facing the problems that you are also facing. Makes you feel that you are not alone and if that can pull it off, you can too.

Zen and the Art of Motorcycle Maintenance : Reading Experience

The Japanese motorcycle maintenance guide says “ Assembly of Japanese bicycle requires great piece of mind”. There is a thing about everything you build, including bikes. If you build it with non-serene mind, then you build your problems into it.

The book takes you on a cross country bike journey that will teach you mind opening lessons that leave lasting impressions on your mind. Your mind will simple refuse to contract itself to older stage.

One of the most important lesson that book teaches you is to enjoy the common little things that life has for you. There is as much Buddha in cogs of bike, as there is at the top of the mountain.

Towards the beginning of the book the author says, “If you want to set out for the most amazing bike journey, you have learn the art of motorcycle maintenance.” The quote has so many meanings at different levels that your mind can explore the words in infinite ways.

As the bike journey progresses, author makes the point that the key to be doing great work is to be completely involved in it. Not like mechanics who listen music while working on the bike with no intention to make it great, the noise of the tools should be music.

How we see the world affects how we think about it. There are two ways to see the world, the classical way where everything is logical and the other is the romantic way.

Classical way of thinking runs the knife on views, something is cut. And when the logic in the logic is found, the beauty of the unknown is lost.

Romantic way of thinking is all about enjoying the continuum of things.

Quality is the thing that author says that you know what it is, but still you can not define it. Like you know what makes a tomato soup good, but yet you can not define what makes up its quality, both materialistic and spiritual.

World consists of three things : Mind, Matter and Quality.

The author was a student of University of California at one point, before his nervous breakdown. Studying there he made some amazing point on the thinking of Plato and Aristotle. How dialectic way of thinking is different from rhetoric way of thinking, but at the same time one doesn’t proves the other wrong.

My two the favorite quotes from the book are :

  1. “The only zen you’ll find at the top of the mountain, is the zen you take with you”.
  2. “The test of the machine is the satisfaction it gives you. There isn’t any other test. If the machine produces tranquillity it’s right. If it disturbs you it’s wrong until either the machine or your mind is changed.”

This is the best book that I have ever read. No matter what you are doing in your life and how old are you, this books touches your mind at levels so deep that you didn’t even think it was possible. But you’ll have to keep the beginner’s mind to learn.

As the author states, “sometimes it is better to travel than to arrive”. I was carried away with the philosophical ideas presented in the book and the serenity that the country side description provides.

Knowing that Chris, the son of the author, with whom he set out for this bike journey is dead was a little sad. But again in snap that increases the importance of all the lesson and the author was expounding throughout the book about life and zen.

A recommended read for everyone.

The next book that I have picked is “The Blue Ocean Strategy”.

Rise and Shine : How joining the 5 AM club affected my life

Being an early riser isn’t about trumpeting how hard you work. It’s about doing everything within your power to help your business achieve success; and if that means you have to get up at an hour not known to most, then you might as well enjoy the sunrise.

It is no secret that many high achievers have been advocating about the importance of waking up early in the morning. I have been following Robin Sharma for quite some time now and he proposes something called as the “5 AM club”. He refers it is as the elite club of people who wake up at 5 AM, each day and try to get the most out of the day.

I took the challenge for myself to wake up at 5 AM every day without fail for the entire month of November as a habit building process. I believe that against all the odds if you can sustain the habit for 1 month, you can stick with it for a longer time. That is the power of habit.

Becoming an early riser

It was obviously not easy to become an early riser. I had a typical teenager schedule prior to this. Stay up late till 2 AM and then sleep till 10 AM.

The first step I took was to decrease the waking up time gradually. Reducing it by 1 hour every 3 days.

I needed some additional help anyways. I asked one of my friends to wake up at 5 AM (Saumya this is you :P). If someone is holding you accountable for something, there is always a push to do it.

How waking up at 5 AM affected my mind and life?

  1. It allows me to enter the flow state : You get up early in the morning, no one is up. Enough time to do self-introspection and follow the morning rituals to get in the mood to conquer the world.
  2. Intrinsic motivation : When you get stuff done in the morning itself. It acts as an intrinsic motivation to keep going. You are optimistic and energetic for the entire day.
  3. Self-discipline : I started this challenge at the worst time. Cold November mornings. It took me a lot of mental strength to get out of warm bed to cold weather. But in the end, it was all worth it.

My new “Early Birdie” morning rituals

I wake up at 5 AM nowadays, and seldom fail at that.

5:30 to 7:30 is the time set apart for personal improvement. No email, no internship work, no college studies. Working on skills that you want to see yourself doing better with.

7:30 to 8:30 I exercise. Again the importance of exercising can not be emphasized more to become a high achiever. It gives more energy that is always helpful.

Then around 9 I start working and go forward with the day.

11 PM is the time to call the day and prepare for tomorrow. No mobile phone to bed and doze off at 11:30.

Do we all have to wake up at 5?

Yes and no. Though I certainly recommend it to try being the member of the 5 AM club at least once. Experience the hours of the day that are not known to most. Feel the sunrise and early morning serenity. It is a different kind of experience, a zen on its own.

How to Sell Your Product or Service by Victor Antonio : Course Experience

Every entrepreneur I follow have this strong ability of closing sales. After all if your very nice product doesn’t sell, it is not nice.

Sales is also, how you present your company to others. Then let it be market research, approaching concierge customers or VCs, all involves sales thinking.

So, we are planning to make are first market research trip. We are going to meet unknown customers and try to get their views on what we are trying to do. I didn’t want to go unprepared for this, so I took this little video series course of basics of sales.

You can find it here if you are interested : https://www.youtube.com/watch?v=kGnjRC0UckA

I wrote the following notes for my personal references but I decided to post them here so that it can server as sales 101 to anyone interested.

This course was divided in 11 parts. Each part being a 6-8 minute video covering one topic. I have tried to summarize the course here.

PART 1 : Having the correct mindset

Maintain correct mindset while going to sell.

Think it as you are going to share information that can benefit your customer.

Share stories that will benefit them.

Don’t pressurize them to buy just share information with them.

Just give them a nudge to buy not a push.

You want to share info and then just give them a nudge to try your product.

PART 2 : YOUR PRODUCT INVENTORY

Product inventory has 3 parts :

  1. Our products has … ( the features).

  2. Which will allow you to… (the benefits).

  3. And that means you can … (the advantages).

1. Create list of features, key features not more than 7.

2. Against each feature write. Benefits and advantages.

Create a table for this.

PART 3 : DEFINING CLIENT PROFILE AND MARKET SEGMENTS

TAM : Total Available Market. This is the whole market. But of course we can’t target the whole market as our audience.

We have to profile the customers. List, categorize and prioritize them .

In prioritized list, create the hitlist where your chances are high.

PART 4 : DEVELOPING A COMPARATIVE ANALYSIS :

How client perceives your product compared to your competitors is very important.

Prepare a comparative analysis chart for features that you provide and which features are your competitors providing.

Now we can answer how you are better/ different than this?

We can differentiate our product from the others now.

PART 5 : DESIGNING A SALES PROCESS

7 STEPS:

  1. Research : FBAs , customer problems etc.

  2. 1st meeting : Questionnaires, know the situation.

  3. Presentation : Present what you have to offer.

  4. Demo : Show how your product will do that.

  5. Options : Different packages

  6. Pricing : Quote price believing that it is correct.

  7. Close the sale : Seal the deal!

Keep tweaking that process till you get it right.

PART 6 : INTRODUCTION MEETING AND AND ASKING QUESTIONS :

There are 2 types of questions :

Open Ended : That asks for more subjective information.

ex. How has been this product performing for you?

Close Ended : Generally one word answers. Ex. Do you like this product?

Idea is to use the open ended questions to know more about the customer. Get the hold of his situation, his problems.

And use the close ended questions to take confirmations. Ex. Would like to consider a new selling platform?

Let the customer do the talking here. (80-20 rule).

PART 7 : DELIVERING A SALES PRESENTATION :

This is where you start to talk about your product’s features and benefits.

Also incorporate the problems that the customer addressed during the questionnaire phase.

In addition to this block the objections. It means address the objections before they are raised by the customer. This makes you more on command and doesn’t make you sound defensive when the customer raises them.

Ex. Our price is high, and let me explain it to you why….

This makes you more in tune with the customer.

PART 8 : DEMONSTRATING YOUR PRODUCT

Always prefer live demo if possible. Show the customer how the product works and can solve their problems. Use lots of visuals.

Focus on problems solved and advantages offered.

PART 9 : DEVELOPING OPTIONS FOR CLIENTS

Educate not tell your customers what there options are. Give the pros and cons of each options package that you offer them. Ideal number of options are 3.

This was the customer buys the middle one.

The fourth hidden option is telling them why they need to take action. What will be the long term losses if they are not considering about the problems that you are going to solve.

PART 10 : PRESENTING PRICING

Don’t hesitate telling the price. Believe that what you are offering is worth that much.

I have really liked this sales thing so far. Even if you are not into sales or not trying to start a company, a little sales knowledge can come handy. After all everyday either are selling something or being sold.

I also added the book “The Sales Bible” to my to-read list. Excited to read that one too.

Business in Boxers 2 : The Rainbow Shelf

As a 16-17 year old you try to figure out what you want to do with your life and then you just imagine yourself doing that. I am a kind of person who imagines stuff very vividly. Few years down the time river here I am, trying to work as hard as I can in the scorching summer heat on something that I always wanted to do.

Second month working on the startup I always wanted to do. Another month passed by, another month that makes you realise that time doesn’t stop for anyone. It doesn’t care if you have excuses, if you are not prepared enough. It just continues to flow. So the best strategy is to just go with the flow and moving forward, even if it’s the tiniest step possible.

This month I tried to put my full team to action. We bought the domain after many discussions on the name. We agreed to the name “Rainbow Shelf“. Personally I find this name very me. The word rainbow depicts my technicolor imagination and how I see this company grow.

After many arguments on what should be the core features that we want in our MVP, we finally got to a truce point.

Assigning roles to team members is something that you don’t want to force too much but yet you want that to be perfect so that it covers the strengths of every person. Out of hundreds of roles that you have to play in your startup, i wanted to make sure that everyone picks the one that they really love. Because if you don’t like what you are working on, what’s the point of working on a startup. I am still not sure whether I have got this right, but it seems to be moving in right direction.

While working on your startup you always have to keep on your helmet, just in case your heads caves in. Out of the blue some team member will raise concerns about the whole idea that you are betting on and you have to handle that and act optimistically no matter how scared you are inside.

During this whole month and for coming months, I am working with a startup based in Bangalore (http://healthgraph.in). The CEO is the best mentor I can ever wish for, seeing him work is what makes you push to go that extra mile and stay up that extra hours in a hope that it’ll make all the difference in the end.

One more lesson I have learned is that you just can’t expect every person on your team to work as hard and passionately as you. You have got to respect their capabilities.

At the start of the month, I created a timeline, a master schedule that we were supposed to follow. Recently I cut that into 1/3. Just so that we always remain on our toes.

Under thing that I have realised is that, don’t panic if you find out that your startup idea is already taken. Chances are that your idea is already present, if you haven’t found it yet then may be you haven’t researched that well. Afterall nothing is new under the sun.

Building a successful business depends less on uniqueness of idea and more on how you are filling the gaps in the market.

One more habit that I have developed is to read a good inspirational book the first hour and the last hour of the day. Just so that I can start and end the day with the correct mindset.

That’s all for this month. Stay Tuned!

 

Couchbase : CB020 and CB140 Experience

Last week in one of my project I wanted to store data of a form having more than 100 fields. I knew storing this much scattered info on relational DBs would be tough. Platform being mobile, just made things more complicated. Indications were to use a NoSql DB.

For  what I found, Couchbase lite is the best NoSql database for mobile. It is available for both Android and ios platform and thus creating apps for both platforms becomes easy.

The usage of DB was pretty advance and thus I decided to take the courses offered by Couchbase. I took 2 courses :

  1. CB020 : Fundamentals of NoSql data management
  2. CB140 : Couchbase lite for mobile 

CB020 : Fundamentals of NoSql data managment

This course was pretty basic. It covered what is big data, why scattered data can not be stored in RDBs and how NoSql is a life savior in these situations.

Most interesting concept was CAP theorem.

C : Consistency ,

A : Availability 

P : Partition Tolerance

It says that in a database you can achieve any two.

C and P : MongoDB and Couchbase

C and A : MySql and Oracle

A and P : Apache,  HBase

 

CB140 : Couchbase Mobile

This one covered basics of couchbase lite, a mobile NoSql database. Pretty simple to use.

On Android projects it can be added as gradle dependency and the APIs are also well equipped and easy to use.

Couchbase being a document based database provides a document based storage which are used to store data as JSON.

Course covered reading documents, updating and deleting documents. What is couchbase server and what is sync gateway. With code samples being presented and explained, you’ll get good hold of couchbase in short period of time.

Both the  courses took me around 6 hours to complete and the time I’ll save by not writing buggy code will be much more than this.