Langsung ke konten utama

Postingan

Menampilkan postingan dari April, 2016

Tutorial: Android ListView With Custom Adapter

There are so many apps utilizing ListView in Android. Your feed in a social network, your tasks in a to-do app, even your mail in your favorite email app stored in a ListView. Basically, ListView is a container for a collection of items that can be represented as an array. You should be able to get any item from a collection by its index and get the size of an underlying collection. Also, it would be nice to be able to add new elements to your collection unless you want it to be constant. In my opinion, ArrayList  fits this definition perfectly. In ArrayAdapter , they use List as an underlying collection, though, but in some implementations of it ( LinkedList  for example) get operation is linear of index you pass to it, so it can be bad for performance. But it's not a reason to reject ArrayAdapter, just be careful with what implementation you pass to it. Custom List Adapter ArrayAdapter by default adapts only strings to TextViews, but we want something more interesting. Let'

What if there is a similar app that is more successful than yours?

It's so much easier to publish your app in Google Play than in Appstore, that's why there are so many similar apps in Google Play. It creates conditions for healthy competition among developers. To perform well in this competition you should always keep your app better than the others. But what if your app is already losing? What if there is an app that has a larger audience than yours? Actually, I think that it's not even a problem. It's an opportunity! An opportunity Wait, what? An opportunity? Why losing to another app is an opportunity? Because you losing a battle not the war! Actually, I think that software market is a place where nobody can win the war. It's Infinite War (not the Infinity War, though), with many many small battles. Still, why losing a battle is an opportunity? Because if you analyse the reasons of losing, and why your opponent is winning you can gather very useful information. With this information, you can come up with a plan that is even bet

How To Get an Idea For an App

There are two common problems in software development, lack of knowledge and lack of ideas. For today's post let's consider the second one. Lack Of Ideas Suppose you have, decent skill in software development, so what other you need to start developing software? Right, the Idea (and IDE of course).  So where do you find them? This question is often the main struggle for many software developers. Common Pattern Look at apps on your smartphone. What is common between all of them? Yes, they are all some way useful, not productive, though, but useful. An app should be useful It's surprising how many devs don't understand that. Every app is useful in its own way. Some app lets you manage your personal finances, some helps you with time management, there are a bunch of apps that let you stay connected with friend and family (e-mail/messenger apps), and some of them help you avoid boredom (I still have Flappy Bird installed for the emergency case). So most of the apps (not onl

How To Combine Learning And Developing part 2

Read 1'st part of this post  where I talk about Learning While Developing. Hi! Today I'll tell you about the second (and I think the right one) way of combining learning and development. This way I call Developing While Learning. Oh wait, sounds like it is the same thing as Learning While Developing, isn't it?  Yes, it might sound like the same thing, but in fact, it's opposite. Let me explain what it all means. The essence of Developing While Learning As I said Developing While Learning is the opposite to Learning While Developing, so you might already guess the essence by yourself. Developing While Learning is about creating some product while learning something. But it shouldn't be your dream project. It should be something appropriate for your level. With time, probably your learning projects will be more difficult, but when you're starting out don't go right off the bat. Even most experienced developers start with "Hello world!" app when they

How to Perform Rest API using Retrofit in Android (Part-2)

In this post, I will show you How to use Retrofit in Android. Retrofit is a new born baby of web services such as AsyncTask, JSONParsing and Volley.In Previous Part , I showed the PHP Scripts to perform basic CRUD operations. In this part, Contains the informations about how to perform Retrofit Operations in Android. Project Structure: Create New Project in Android Studio with blank activity as in the following. We need Retrofit Library for working with that. For Android Studio you just need to paste below line of code under dependency of build.gradle file. compile 'com.squareup.retrofit:retrofit:1.9.0' For eclipse users download jar file from below link and add to you project. Download jar AndroidManifest.xml Don't forget to add the following permission in your manifest file <uses-permission android:name="android.permission.INTERNET"/> AppConfig.class Create AppConfig.class and replace it with the following code.It is used as helper class for web services