26 Ocak 2017 Perşembe

PHP Fatal error: Uncaught exception 'ImagickException' with message 'PDFDelegateFailed

Convert PDF to Image (JPEG,JPG,PNG)  with PHP
How do I convert a PDF to image 

Php 6 version causes problem that you are given as you use Imagick Somehow it works well in Php 5
(Php 6 ile bu sourun oluşuyor Ancak Php 5 de çalışıyor  )
  
So I got solution after searching lots of resources and reading 

SOLUTION:
(ÇÖZÜM)

$pathToPdf="/......";                      //pdf dosya dizini

$pathToWhereImageShouldBeStored="/...."          //resmin yükleneceği dosya dizini


//Counting page of pdf(Pdf deki toplam resim sayısını getir)

$pageCount = exec("/usr/bin/identify -format %n ".$pathToPdf);


//converting pdf to imgs (pdf i resimlere dönüştürme)

for($i=0;$i<$pageCount;$i++){
exec("convert ".$pathToPdf."[".$i."] ".$pathToWhereImageShouldBeStored.$i.".png");
} 


NOTE: GhostScript should be installed ! 

22 Ocak 2017 Pazar

PHP Verileri Json'a Aktarırken Türkçe Karekter Sorunu(json_encode())

ÇöZÜM:

Php 'de Diziyi encode ederken türkçe karekter sorunu yaşıyorsanız
aşağıdaki gibi düzeltin.
echo json_encode($results,JSON_UNESCAPED_UNICODE);

3 Ocak 2017 Salı

dlopen failed: library "nulllibstlport_shared.so

If you get  like this error. (Böyle bir hata alıyorsanız.. )

 java.lang.UnsatisfiedLinkError: dlopen failed: library "nulllibstlport_shared.so" not found
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:982)
at io.vov.vitamio.MediaPlayer.(MediaPlayer.java:257)

 SOLUTION:

Before starting video call the line   as shown below (Note that  use it onCreate())
Vidyoyu başlatmadan aşagıdaki kodu onCreate metoduna eklyeyin

Vitamio.isInitialized(this);

31 Aralık 2016 Cumartesi

getContentLength() returning -1

Android url connection getContentLength() returning negative value (-1) ?

SOLUTION
(ÇÖZÜM)

add this line 
(Bu satırı ekle)

urlConnection.setRequestProperty("Accept-Encoding","identiy");
.
.
.
as it's shown below
(aşağıda gösterildiği gibi)

HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestProperty("Accept-Encoding","identiy"); // <--- Add this
int length = urlConnection.getContentLength();

22 Aralık 2016 Perşembe

To get Certificate fingerprint(MD5) (Parmak izi sertifikası nasıl alınır) for android



  • cd C:\Program Files\Java\jdk1.7.0_79 (note jdk version might be different in your pc )(Kodu yazın)
  • keytool -exportcert -alias androiddebugkey -keystore "C:\Users\userName\.android\debug.keystore" -list -v (Kodu yazın)
  • If it asks keystore password it's default  " android " type it ok (Şifre sorarsa "android" yazın )
  • Ok! you are done results are displayed for you (Tamamdır sonuçlar ekranda görüntülenecek)
  • how to run the key hash for facebook

    To get android key hash for facebook app (Facebook app için android key hash nasıl alınır) 


    • Download open ssl for windows here (dosyayı indirin)
    • Unzip it  to C drive as "openssl " file (Dosyayı "openssl" olarak C sürücüsüne çıkartın)
    • Open cmd prompt(Komut istemini açın)
    • Type cd C:\Program Files\Java\jdk1.7.0_79\bin (note jdk version might be different in your pc)(komutu yazın- jdk version sizde farklı olabilir ayrıca bakın)
    • And Finally type keytool -export -alias myAlias -keystore C:\Users\your user name\.android\myKeyStore | C:\openssl\bin\openssl sha1 -binary | C:\openssl\bin\openssl enc -a -e(Kodu yazın)
    • If it asks keystore password it's default  " android " type it ok (Şifre sorarsa "android" yazın )
    • You are done!  ( Bitti ! )

    12 Aralık 2016 Pazartesi

    android.content.res.Resources$NotFoundException:

    " FATAL EXCEPTION: main
                      android.content.res.Resources$NotFoundException: String resource ID #0x4
                          at android.content.res.Resources.getText
     "

    This exception occours Even when the resource is presents 

    It's most likely setting anything except string in text like here;
    (Büyük ihtimalle setText() ederken aldığı değer string değil örnek;)

     int i=10;
    mtextView.setText(i);

     it gets error above.It should be converted to string
    (Yukarıdaki hatalı.Değerin tipi stringe çevirilmelidir)

    SOLUTION:

     mtextView.setText(String.valueOf(i))