Tag: Android

Gradle İyileştirmeleri

Android ile gelen gradle plugin ile derleme ve sonrasında farklı işler yapabiliyoruz. Öyle ki bu plugin de java ile yazıldığını söylersem ne kadar şey yapabileceğimizi daha iyi anlatmış olurum sanırım. applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = new File( output.outputFile.parent, output.outputFile.name.replace(“.apk”, “-${variant.versionCode}.apk”)) } } Yukarıdaki kod derlenen apk’nın isminin sonuna Manifest’te yazılı… Read more »

app:transformClassesWithDexForDebug solution

I have faced below problem Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. > com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {–dex –force-jumbo –num-threads=4 –multi-dex –output C:\Users\dtyunlu\AndroidStudioProjects\iris-mobil-android\app\build\intermediates\transforms\dex\debug\folders\1000\5\slice_2 C:\Users\dtyunlu\AndroidStudioProjects\iris-mobil-android\app\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_2} Although, tried the solutions from here : https://stackoverflow.com/questions/33915955/android-studio-transformexception-errorexecution-failed-for-task-apptransf didn’t solve my problem. So I have deleted this part from my gradle: dexOptions… Read more »

SimpleDateFormat kullanımı

Amacımız bize “25.05.2017 09:00” gibi gelen bir tarih string’ini doğru parse istediğimiz formatta çıktı alabilmek. Sadece saat kısmı için : “09:00” gibi sadece tarih için “25:05:2017” “2001-07-04 12:08:56” şeklinde U.S. Pacific Time time zone da gelen stringi alıp 12:08 PM  olarak veya 12 o’clock PM  bastırabiliriz. 2001.07.04 AD at 12:08:56 PDT  => PDT pasifik daylight time… Read more »

Android version code ve version name

Bu değerler Androidmanifest.xml içinde <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.yusuf.mobil” android:installLocation=”auto” android:versionCode=”2″ android:versionName=”2.0″> … olarak yazılır. Ancak build.gradle ile de override edilebiliyor. defaultConfig { applicationId “com.digiturk.iris” minSdkVersion 16 targetSdkVersion 25 versionCode 1 versionName “1.0” multiDexEnabled true }

Zxing duplicate entry problem

When I was trying to signing my apk which include embedded zxing barcode scanner , it was giving this error: Error:Execution failed for task ‘:app:transformClassesWithJarMergingForRelease’. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/integration/android/IntentIntegrator.class I have spent my last 5 hours to solve this. So finally I got why it happens. For some reasons or accidently I did… Read more »

Örnek bir Cachemanager

Android’de öyle bir cachemaneger yazmak istiyorum ki: Varsa datayı Ram’den getirsin, yoksa dosyadan okuyup getirsin. Android’de bu dosya sharedpreferences isimli XML dosyasıdır. İlk olarak Ram’den getirsin ki dosyadan okuma işlemi ile bir zaman kaybı(overhead) olmasın. Tabi bunun için bu manager aracılığı ile Ram’de duran herşey dosyaya da yazılmalı. İkinci olarak bu data farklı class tiplerinde veya… Read more »

Crashlytics list my app but doesn’t show crashe reports

Finally solved this problem. I have been curious why it doesn’t work even though my other app’s crashlytics report works well. Gradle was guiltyas usual 🙂 if you are in same situation so make sure applicationId is correct defaultConfig { applicationId “com.unlu.mobil” minSdkVersion 15 targetSdkVersion 24 // Enabling multidex support. multiDexEnabled true }

exo player gradle problem

I used to have a problem with exo player while working with build.gradle solution : remove maven central from repositories and add jcenter() only if you use viewpagerindicator library you will have to find out to get it because of removing maven central. I gave a try take it to local so it works 🙂