Aşağıdakı kod apk dosyasına aittir ben bunu web tabanlı yapmak istiyorum yardım edebilecek arkadaş varmı javadan anlayan
package com.yesilmen.imeisorgulama;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.text.Editable;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdRequest.Builder;
import com.google.android.gms.ads.AdSize;
import com.google.android.gms.ads.AdView;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class MainActivity extends Activity
{
final int DEFAULT_TIMEOUT = 20000;
public AsyncHttpResponseHandler a = new AsyncHttpResponseHandler();
private AdView adView;
public Button al;
public Boolean baglanti;
public ImageView bilgi;
AsyncHttpClient client = new AsyncHttpClient();
public Document doc;
public Document doc2;
public EditText edittext;
public RequestParams params;
public ImageView paylas;
public ProgressDialog progressView;
public ProgressDialog progressView2;
public Button sorgula;
public Button temizle;
private void sorgula(String paramString)
{
try
{
this.client.setTimeout(20000);
this.client.get("https://www.turkiye.gov.tr/imei-sorgulama", new AsyncHttpResponseHandler(paramString)
{
public void onFailure(Throwable paramThrowable, String paramString)
{
super.onFailure(paramThrowable, paramString);
Toast.makeText(MainActivity.this, "İşlem Yapılırken bir hata oluştu! (" + paramThrowable.getMessage() + ")", 0).show();
}
public void onFinish()
{
super.onFinish();
MainActivity.this.progressView.dismiss();
}
public void onStart()
{
super.onStart();
MainActivity.this.progressView = new ProgressDialog(MainActivity.this);
MainActivity.this.progressView.setIndeterminate(true);
MainActivity.this.progressView.setCancelable(true);
MainActivity.this.progressView.setTitle("Bağlantı Sağlanıyor");
MainActivity.this.progressView.setMessage("Lütfen Bekleyiniz...");
MainActivity.this.progressView.show();
}
public void onSuccess(String paramString)
{
try
{
String str = Jsoup.parse(paramString).select("input[name=token]").first().attr("value");
MainActivity.this.params = new RequestParams();
MainActivity.this.params.put("txtImei", this.val$imei);
MainActivity.this.params.put("token", str);
MainActivity.this.client.addHeader("Referer", "https://www.turkiye.gov.tr/imei-sorgulama");
}
catch (Exception localException1)
{
try
{
MainActivity.this.client.post("https://www.turkiye.gov.tr/imei-sorgulama?submit", MainActivity.this.params, new AsyncHttpResponseHandler()
{
public void onFailure(Throwable paramThrowable, String paramString)
{
super.onFailure(paramThrowable, paramString);
Toast.makeText(MainActivity.this, "Veri Alınırken bir hata oluştu! (" + paramThrowable.getMessage() + ")", 0).show();
}
public void onFinish()
{
super.onFinish();
MainActivity.this.progressView2.dismiss();
}
public void onStart()
{
super.onStart();
MainActivity.this.progressView2 = new ProgressDialog(MainActivity.this);
MainActivity.this.progressView2.setIndeterminate(true);
MainActivity.this.progressView2.setCancelable(true);
MainActivity.this.progressView2.setTitle("Bağlantı Sağlandı");
MainActivity.this.progressView2.setMessage("Veri Alınıyor...");
MainActivity.this.progressView2.show();
}
public void onSuccess(String paramString)
{
try
{
Document localDocument = Jsoup.parse(paramString);
String str1 = localDocument.select("dl.compact dd").get(0).text();
String str2 = localDocument.select("dl.compact dd").get(1).text();
String str3 = localDocument.select("dl.compact dd").get(2).text();
String str4 = localDocument.select("dl.compact dd").get(4).text();
Intent localIntent = new Intent(MainActivity.this, SonucActivity.class);
localIntent.putExtra("imei", str1);
localIntent.putExtra("durum", str2);
localIntent.putExtra("kaynak", str3);
localIntent.putExtra("marka", str4);
MainActivity.this.startActivity(localIntent);
return;
}
catch (Exception localException)
{
Toast.makeText(MainActivity.this.getApplicationContext(), "E-Devletten Veri alınamadı!Lütfen Kısa bir süre sonra tekrar Deneyiniz..", 1).show();
}
}
});
return;
localException1 = localException1;
Toast.makeText(MainActivity.this.getApplicationContext(), "E-Devletten Veri alınamadı!Lütfen Kısa bir süre sonra tekrar Deneyiniz..", 1).show();
}
catch (Exception localException2)
{
Toast.makeText(MainActivity.this, "Veri Alınırken bir hata oluştu!", 0).show();
}
}
}
});
return;
}
catch (Exception localException)
{
}
}
protected void exitByBackKey()
{
new AlertDialog.Builder(this).setMessage("Programı Kapatmak İstiyormusunuz?").setTitle("IMEI Sorgulama").setPositiveButton("Evet", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface paramDialogInterface, int paramInt)
{
MainActivity.this.finish();
}
}).setNegativeButton("Hayır", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface paramDialogInterface, int paramInt)
{
}
}).show();
}
public boolean isOnline()
{
NetworkInfo localNetworkInfo = ((ConnectivityManager)getSystemService("connectivity")).getActiveNetworkInfo();
return (localNetworkInfo != null) && (localNetworkInfo.isConnectedOrConnecting());
}
public boolean onContextItemSelected(MenuItem paramMenuItem)
{
switch (paramMenuItem.getItemId())
{
default:
case 1:
case 2:
}
while (true)
{
return super.onContextItemSelected(paramMenuItem);
startActivity(new Intent(this, HakkimizdaActivity.class));
continue;
String str = "https://play.google.com/store/apps/details?id=" + "com.yesilmen.imeisorgulama";
Intent localIntent = new Intent("android.intent.action.VIEW");
localIntent.setData(Uri.parse(str));
startActivity(localIntent);
}
}
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130903040);
LinearLayout localLinearLayout = (LinearLayout)findViewById(2131230748);
this.adView = new AdView(this);
this.adView.setAdSize(AdSize.SMART_BANNER);
this.adView.setAdUnitId("ca-app-pub-0876445197251715/6586199560");
localLinearLayout.addView(this.adView, 0);
AdRequest localAdRequest = new AdRequest.Builder().build();
this.adView.loadAd(localAdRequest);
this.paylas = ((ImageView)findViewById(2131230764));
this.bilgi = ((ImageView)findViewById(2131230765));
this.bilgi.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
MainActivity.this.registerForContextMenu(MainActivity.this.bilgi);
MainActivity.this.openContextMenu(MainActivity.this.bilgi);
}
});
this.paylas.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
Intent localIntent = new Intent("android.intent.action.SEND");
localIntent.setType("text/plain");
localIntent.putExtra("android.intent.extra.TEXT", "Cihazının İmei numarasını https://play.google.com/store/apps/details?id=com.yesilmen.imeisorgulama adresindeki program ile sorgulayabilirsin.");
MainActivity.this.startActivity(Intent.createChooser(localIntent, "Arkadaşınıza Önerin"));
}
});
this.baglanti = Boolean.valueOf(isOnline());
if (!this.baglanti.booleanValue())
Toast.makeText(getApplicationContext(), "İnternet Bağlantınız olmadan Sorgulama Yapamazsınız.!", 1).show();
this.edittext = ((EditText)findViewById(2131230744));
this.sorgula = ((Button)findViewById(2131230747));
this.al = ((Button)findViewById(2131230745));
this.temizle = ((Button)findViewById(2131230746));
this.al.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
try
{
String str = ((TelephonyManager)MainActivity.this.getSystemService("phone")).getDeviceId();
MainActivity.this.edittext.setText(str);
return;
}
catch (Exception localException)
{
Toast.makeText(MainActivity.this.getApplicationContext(), "Cihazınızın imei numarası alınamadı!", 1).show();
}
}
});
this.temizle.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
MainActivity.this.edittext.setText("");
}
});
this.sorgula.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
if (MainActivity.this.edittext.getText().length() != 15)
{
MainActivity.this.edittext.setFocusableInTouchMode(true);
MainActivity.this.edittext.requestFocus();
MainActivity.this.edittext.setError("İmei Numarası 15 Haneli Olmalıdır!");
return;
}
String str = MainActivity.this.edittext.getText().toString();
MainActivity.this.sorgula(str);
}
});
}
public void onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
{
paramContextMenu.setHeaderTitle("İmei Sorgulama");
paramContextMenu.add(0, 1, 0, "Hakkında");
paramContextMenu.add(0, 2, 0, "Puan Ver");
}
public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
{
if (paramInt == 4)
{
exitByBackKey();
return true;
}
return super.onKeyDown(paramInt, paramKeyEvent);
}
}