Coder Social home page Coder Social logo

tolgahanuzun / sc_image_processing Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 105 KB

Server Client iliskisi ile geliştirilmiş Android Resim Isleme uygulaması.

Java 87.27% PHP 8.20% Python 4.52%
android-client android-application image-processing python-server php-htmldiff

sc_image_processing's Introduction

Android Tabanli Resim Isleme Ornegi

##Android-Client

Uygulamanin bu kismi, internetteki kaynaklardan yararlanildi. Burada kendinize gore degistirmeniz gereken bir kac veri bulunuyor. Asagidaki basliklardaki kod satirlarini kendinize gore duzeltmeniz gerekiyor.

PHP kodunuz fotografin anlik olarak buffer gorevi gorecek basit bir sitede depolanmasina yariyor. Ayrica veri giris ve cikisin kolay olmasida guzel avantajlardan.

Alttaki basliklar -> app -> src -> main -> java -> edu -> ktu -> wp -> homework

Config

Php yuklu olan endpoint belirtiyoruz.

FILE_UPLOAD_URL = "http://domain.com/fileUpload.php"; 

ShowActivity

Php kosulan web sitemizin resimleri kayit ettigi dizini tanimliyoruz.

public static final String IMAGE_URL = "http://domain.com/uploads/IMG.jpg"; 

UploadActivty

Burada tanimlanan mail, php dosyalari arasinda bir kontrol yapip resim islenmesini sagliyor. Bu yuzden bu mail adresi onemli.

entity.addPart("email", new StringBody("[email protected]")); 

Image-Server

Resmin bir site uzerinde yuklenmesi ve soket baglantisi ile resim islenmesi ve baska bir server ile haberlesmesi icin bu ara katman kullanildi. Ayni islem aslinda direk uzak sunucudaki bilgisayar uzerinde yapilabilirdi. Request isteklerini bu sekilde parcalamak, uretkenlik acisindan daha kolaylik sagladigi icin tercih edildi. Zaman sikintisi olmasaydi, flask ile daha kontrollu ve guzel bir odev ortaya cikabilirdi...

fileUpload

Buradaki email'in android cihazimizdaki kodlarin arasindaki email ile ayni olmasina dikkat etmek gerekiyor! DigitalOcean uzerinden sunucu alip asagidaki python kodlarini kostuktan sonra ip adresi ve tanimli port ile soket baglantisini asagidaki sekilde kurabilirsiniz.

if($email=='[email protected]'){

host    = "Sunucununipadresi";
$port    = 8080;

Process-Server

DigitalOcean uzerinden alacaginiz bir ubuntu server'a proje icerisindeki import edilmis paketleri PIP yardimi ile yukleyin. Resim isleme kutuphanesi Python2 ile calistiginin altini cizmek istiyorum!

PHP burasi ile bu paremetreler sayesinde haberlesiyor. 0.0.0.0 kendisine isaret eden bir yapi oldugunu ve degistirmemeniz gerektgini soyleyeyim. Ayni sekilde PORT numaraniz php kodlariniz icerisindeki port ile ayni olmalidir.

HOST = '0.0.0.0'
PORT = 8080

Diger kodlarin anlasilirligi konusunda bir sorun yasayacaginizi dusunmuyorum.

Kodu kaydettikten sonra terminalde asagidaki komutu calistirarak, ssh kapatinca kapanmayan bir process halinda uygulamayi calistirmis oluyorsunuz. Bunun calisip calismadigini gormek icin ise 'ps aux' komutunu kullanabilirsiniz.

chmod 777 ./server.py
nohup ./server.py </dev/null &>/dev/null &

Projeden Goruntuler

1

2

Proje Gelistiricileri

  • Abdullah Velioğlu
  • Tolgahan Üzün

sc_image_processing's People

Contributors

tolgahanuzun avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

abdvel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.