Skip to main content

Android'de ilk uygulama :"Hello World" uygulaması

Eclipse üzerinde android için ilk uygulamamızı geliştirmeye başlayalım. Diğer popüler dillerde olduğu gibi android'de de ilk deneme uygulamamız ekrana "Hello World" yazdırmaktan ibaret.

Gerekli kurulumlar önceki yayınlarda anlatılmıştır.

Android üzerinde yazılım geliştirirken görsel arayüzü oluşturmak için XML kodları kullanıcaz. Görsel arayüzün ardında asıl işlemleri yazdığımız java kodları halledecek.

İlk olarak proje oluşturmalıyız. Bunun için File->New->Other tıklanır ve açılan pencereden Android altından "Android Project" seçilir.  Next'e tıklanarak bir sonraki aşamaya geçilir.

Bu aşamada projemize isim vermemiz("Hello World" örnek olarak) ve hangi android API si üzerine kurulacağı seçilmelidir. Bu örnek için API7 (Android_2.1) seçmeniz seçmenizi tavsiye ediyorum.

Next' tıkladıktan sonra karşımıza çıkan ekranda "Package Name" i belirtmemiz lazım. (örn: com.hello.world)

Bu aşamaları geçtikten sonra işlemlerimiz bitmiş oluyor. Artık uygulamamızı çalıştırabilir. Bunun için önceden oluşturduğumuz sanal makineyi kullanacağız. http://komputercevapver.blogspot.com/2012/01/eclipsete-android-sanal-makinesi.html

Packege explorer penceresinden "Hello World" adlı paketi fare ile seçelim ve run a tıklayalım. Karşımıza açılan ekrandan "Android Application" 'ı seçelim. Ok düğmesine basalım.

Daha sonra sanal makine açılacak ve tuş kilidini açtıktan sonra yazdıgımız program calısmaya baslıyacaktır. Ekranda Hello World olan program ismi ve HelloWorldActivity yazıyorsa ilk uygulamamızı başarı ile tamamlamış oluyoruz.

Comments

  1. güzel anlatım olmuş. ilk uygulamamı yazabildim.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to change position of MyLocationButton on new Map API v2 - 2

In my previuos post[1], i mention a workaround for changing buttons on Google Map which we use with google services. It is good to know they listen developers and make their products more development friendly. (I hope it goes like that way all the time and all the product lines of Google) Now we have a method for setting padding of map. It is add padding to useful area of map. We can see full screen map but with padding we can use prefered area of it. It is good for overlay action bar and other things on map view. [ 2] They write a blog and take a video about it. Read blog and watch video if you are using google map in your app :) [3] And finally, They add this method because of this issue. That means, if you find a bug or want extra feature from and api, write to google via this issue tracking system. [1] http://blog.kozaxinan.com/2013/08/how-to-change-position-of.html [2] https://developers.google.com/maps/documentation/android/map#map_padding [3] http://googlegeodeve

How to set alarm to show a notification at future date with AlarmManager?

Lets assume you want to do a job a future time or show a notification at a selected time. AlarmManager can help to send an intent in future time. First we need to select date, Lets create a date in 2050, Calendar calendar = Calendar. getInstance () ; calendar.set(Calendar. YEAR , 2050 ) ; Date date = calendar.getTime() ; For showing notification we need a service. public class AlarmReceiver extends Service { public AlarmReceiver() { } @Override public IBinder onBind (Intent intent) { } } Add service to Manifest.xml <service android :name= "com.kozaxinan.example.alarm.AlarmReceiver" android :enabled= "true" android :exported= "true" > </service> We will modify AlarmReceiver for sending notification. But first we need to register a alarm. AlarmManager alarmManager = (AlarmManager) getSystemService( ALARM_SERVICE ) ; Intent intent = new Intent( this, AlarmReceiver. class ) ; intent.putExtra( &q

Finally I released my First Game; The Red Button

Finally I released  "The Red Button Don't Touch It" . My First Game for Android. Game has only one objective; be fast enough to react and click the green button. Playstore Link :  https://play.google.com/store/apps/details?id=com.kozaxinan.redbutton Please don't hesitate to give me feedback!