Posts

Showing posts from September, 2012

Consuming SOAP web services in Android

Image
     it’s pretty common for android developers to use web services, mmm.. no, let me rephrase, it’s pretty common for every developer to write code which consumes data from a web service, because this is the world we’re living in at the moment, a server serves as a data host for different clients and other servers using data protocols. the most common protocol you’ll use is REST, which means that all the data transferred is basically represented as Json Strings, which is probably the best way to do it, because Json is very easy to understand, parse and generate both on client side, and on server side. Android has great built in support for consuming Restful web services, but it lack support in SOAP web services. Odds are you’ll probably encounter a web service of this sort. so what can we do? A suggested and common solution is to use the free open source library called KSOAP2, which provides us with an easy API for generating requests and parsing responses in a SOAP format. how do

best phone for developing?

       So you are an Android developer now? great. you’ll probably start to develop using eclipse and some emulators (probably min 2.2). most of the developers I know are a bit fed up by the fact that the emulator suffers from a “few” cons. like what? You can’t really use an emulator with a mouse and get a real feel the same way you’ll do using your fingers and the various gestures you’ll use on an actual phone – get a real phone if you’re developing an app which includes picture taking/video recording or sound even, then you’ll find yourself guessing – get a real phone Locations – yes, if you’re developing an application which includes locations and maps, you’ll probably want to test it out. yes, the DDMS offers such emulation of Geolocations but it’s not so fun to use – get a real phone pretty much any sensor that you can’t think about needs a real phone in order to develop it the proper way – get a real phone   ok, we got it, you need to get a phone. which phone? so many re

Practical Android wishes you a happy new year

Hi all, this post will not include any android related tips or code, only a Happy new year from me, thanks for visiting the blog, and hopefully, the coming year will be an android year with a lot of interesting posts, tutorials and general android dev subjects.   thanks Israel

Spinner VS AutoCompleteTextView

Image
       We’ve all been in a situation where we needed to show a list of some sort, a list which should be triggered by a user interaction (click, tap, etc..) A list is simple enough, probably even a spinner if we don’t want to spend that much screen real-estate on showing a list which the user clicks once and probably doesn’t need to see it after that. A spinner can be a real bug once there are too much entries for the user to choose from, how much is too much? that’s a good question – probably it differs from user to user, and probably this will have some performance issues with areal large number of entries, you cannot scroll forever to find what you’re looking for. A simple solutions for the problems mentioned above is an AutoCompleteTextView. it’s a control which is basically a combination of a TextView, EditText, and a Spinner all wrapped up in a single easy to use and configurable control. let’s see how it’s done:   first, in the layout file, create an AutoCompleteTextView

Boil an egg app - step by step (step 3 – code)

Image
  After reviewing part 2 of the tutorial, it’s time for coding. let’s get started. In the main activity class we’ll have the following things to do: 1. set some private variables to be accessed from different places in the class. 2. bind some variables to views from the xml reviewed in part 2 3. set listeners for the different buttons on the screen 4. handle timer changing and displaying time remained   let’s elaborate on this : 1. initialize some variables in the main class, place those prior to the onCreate() method:     private Button btnSmallEgg,btnMediumEgg,btnLargeEgg;     private Button btnCookAnEggTimer,btnResetTimer;     private TextView btnSoftEgg,btnHardEgg;     private TextView tvTimer,tvTimerLabel;     private TextView tvChooseEggSize,tvChooseEggType,tvIntro ;         long minutes;     long seconds;     long maxTimer=600000;     long lastKnowTimer=600000;     final static int boilTimeHardLargeEgg=600000; // 10 minutes     final static int boilTimeSoftLargeEgg=3

Boil an egg app - step by step (step 2 – Layouts)

      After doing part 1 , it’s time for coding – let’s write down the layouts used: layouts it’s easy to see that we have only a single layout, however – we have two: main_layout splash_layout the splash layout is pretty much a nifty way to show the user something that will make him a bit excited, it’s not mandatory, but it’s really nice. let’s review the splash screen and the main layout screen, the 2 files can be found at: https://www.dropbox.com/sh/cieiqif3lpzip2n/gC0jqfrBR6 Basically it’s a single LinearLayout containing an ImageView with the src directed to a png file in the drawables directory called splash. let’s review the main_layout layout: damn! seems like a complicated layout – no, it’s not – being a long xml doesn’t make it complicated, it just means it has a lot of views. lines 8-44 : header, intro text, and label for choosing an egg lines 46-150 : basically the layouts for choosing an egg size buttons, buttons for choosing egg type and the start/reset b

Sched-U App – the first Android application from the Seattle Sela Diamond program

       The Sela diamond program which took place this summer in Seattle involved the training of CS and Electrical Engineering College graduates from the US. The Entire Course involved OOP training, DB training and the last and greater part of the course – Programming for the android platform.      The Objective for the course was to train the students and a final project – An Android Application to be published on the play store, and the first app to bare fruit is the Sched-U app. overview: College students lead hectic lives. A vast majority now carries smart phones. Sched-U is designed to be an assistant to help college students manage getting to their classes on time, notes and assignments, and final exams. target audience: College student who need or want help juggling their class schedule, prioritizing assignments, organizing note materials, and preparing for final exams. The process      From the get go, my objective was not only to teach the android echo system and the