Kişisel Sayfaları
İlgi Alanları
İş Tecrubesi
Eğitim Geçmişi
Sertifikalar & Başarılar
Kullanıcıya ait test sonucu bulunmamaktadır.
Dil Becerileri
Son Forum Aktiviteleri
5Activity Başlatılamadı Hatası!!!
Arkadaşlar uygulamam API 21 yani lollipop ve üzeri sürümlerde iyi çalışıyor fakat anasayfa diye bir bölüm var drawer menü vs var 4.4.4 yani API 19 da çalıştırdığım zaman Anasayfa dışında hepsi normal buna tıklayınca sapıtıyor ve çöküyor uygulama bu hata xml yapısındaki bir hatadan kaynaklanıyor fakat ben çözemedim yapıyı ve logchat çıktısını atayım belki bilen bir arkadaş olur..
<?xml version="1.0" encoding="utf-8"?>
<!--suppress ALL -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:transitionName="content"
android:clipChildren="false"
tools:context=".activity.MainActivity">
<include layout="@layout/toolbar"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/layoutId">
</LinearLayout>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<RelativeLayout
android:id="@+id/nonVideoLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<info.androidhive.uygulamam.activity.VideoEnabledWebView
android:id="@+id/webview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="visible"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/videoLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
<include layout="@layout/fab"/>
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="44sp" />
</FrameLayout>
<FrameLayout
android:visibility="gone"
android:id="@+id/msg_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView2"
android:background="@drawable/hata"
android:layout_gravity="fill"
android:contentDescription=""
tools:ignore="ContentDescription" />
</FrameLayout>
BURASI LİSTEDEKİ MENÜ ÖĞELERİNİ VE LİSTEYİ DÜZENLEME KISMI-->
<ExpandableListView
android:id="@+id/explist_slidermenu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="multipleChoice"
android:divider="@color/selector2normal"
android:dividerHeight="0dp"
android:listSelector="@drawable/list_selector"
android:background="@drawable/rounded_background"
/>
<fragment
android:id="@+id/fragment_navigation_drawer"
android:name="info.androidhive.uygulamam.activity.FragmentDrawer"
android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="end"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
Buda LogChat Çıktısı "java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute." yani "
Bir layout_width niteliğini sağlamanız gerekir." diyor burdaki problem ne arkadaşlar kafayı yicem lütfen biri yardım etsin bana :/
03-12 10:22:26.185 19856-19856/info.androidhive.uygulamam E/AndroidRuntime: FATAL EXCEPTION: main
Process: info.androidhive.uygulamam, PID: 19856
java.lang.RuntimeException: Unable to start activity ComponentInfo{info.androidhive.uygulamam/info.androidhive.uygulamam.activity.MainActivity}: java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5948)
at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6117)
at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1225)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:1062)
at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:82)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:757)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:814)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at info.androidhive.uygulamam.activity.MainActivity.onCreate(MainActivity.java:232)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Şimdiden yardımlarınız için teşekkürler..
İmport.io Webden Kolayca Veri Çekme
https://www.import.io/ sitesini çoğu geliştirici bilir sanırım https://www.kimonolabs.com/ un alternatifi diyebiliriz kimono ekibi Plantire katıldığı için Palantir tarafından satın alındığı için kapatıldı orda webden veri alıp api haline getirip androidde kullanmak çok kolaydı fakat ücretsiz ve güzel bir hizmet olan import.io da oluşturduğum apinin androidde nasıl kullanılacağını bir türlü bulamadım arkadaşlar anlayan bilen yapabilen varsa bu konuda yardımcı olursa çok sevinirim..
Aynı Activity içinde İki AsyncTask Arası iletişimi sağlama?
Merhabalar,
Ben geliştirdiğim uygulamada Mail Gönderme activity içerisinde kullandığım T.C Kimlik No: …….. text viewini Validate yani doğrulamak istiyorum. Bunun için sayfa activity içerisinde iki AsyncTask kullanmak zorunda kaldım biri Maili göndermek diğeride Tc kimlik sorgusunu yapıyor Geçerli yada Geçersiz olma durumunu sorguluyor. Xml kısmında ise aynı aktivity içersinde kullandığım için text viewlerin ıd lerini eşleştirdim mesela mail için ad soyad gerekirken aynı şekilde tc sorgulamak için de ad soyad gerekti ben ikisini aynı id değerinde yaparak hem gmailime kişinin ad soyadını gönderyorum hemde tc sorgulamasını yaptıryorum şimdi sorun şu ki; Ben bu activity de önce tc sorgusunun yapılmasını geçersiz yada sallamasyon bir Tc girilmişse gelen “Geçersiz Tc No” uyarısına göre mailinde gönderilmemesini istiyorum. En kısaca olaraktan doğru tc no girmemişse mailde gönderememesini istiyorum bunu nasıl yaparım?
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import java.io.UnsupportedEncodingException;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.net.UnknownServiceException;
import java.util.Calendar;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import info.androidhive.view.Position;
import info.androidhive.view.SwipeBack;
@SuppressWarnings("ALL")
public class Dogrudanyazin extends Activity {
private static final String username = "halithatice4603@gmail.com";
private static final String password = "**********";
private EditText emailEdit;
private EditText subjectEdit;
private EditText messageEdit;
private EditText nameEdit;
private EditText surnameEdit;
private EditText tcEdit;
private EditText telEdit;
String email ;
String gonderenemail;
String name;
String surname;
String subject;
String message;
String tckn;
String tel;
String regexStr = "^[+]?[0-9]{10,13}$";
// FloatingActionButton facebook,twitter,youtube;
@Override
protected void onCreate(Bundle savedInstanceState) {
//Activityi sağa doğru kaydırınca animasyonlu bir şekilde kapatır
SwipeBack.attach(this, Position.LEFT)
.setSwipeBackView(R.layout.swipeback_default);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dogrudanyazin);
final int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
Spinner birthDateSpinner = (Spinner) findViewById(R.id.birthDateSpinner);
int startYear = Calendar.getInstance().get(Calendar.YEAR);
int endYear = 1900;
String[] birthyears = new String[startYear-endYear];
int count = 0;
for (int i = startYear; i > endYear; i--) {
birthyears[count] = Integer.toString(i);
count++;
}
ArrayAdapter adapterForBirthDate = new ArrayAdapter(this, android.R.layout.simple_spinner_item, birthyears);
adapterForBirthDate.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
birthDateSpinner.setAdapter(adapterForBirthDate);
emailEdit = (EditText) findViewById(R.id.editText_eposta);
subjectEdit = (EditText)findViewById(R.id.editText_konu);
messageEdit = (EditText) findViewById(R.id.editText_ileti);
nameEdit= (EditText) findViewById(R.id.editText_isim);
surnameEdit= (EditText) findViewById(R.id.editText_soyisim);
tcEdit= (EditText) findViewById(R.id.editText_tc);
telEdit=(EditText) findViewById(R.id.editText_telno);
// Button sendButton = (Button) findViewById(R.id.button_gonder);
/* final FrameLayout frameLayout = (FrameLayout) findViewById(R.id.frame);
// frameLayout.getBackground().setAlpha(0);
final FloatingActionsMenu fabMenu = (FloatingActionsMenu) findViewById(R.id.fab_menu);
facebook=(FloatingActionButton)findViewById(R.id.fab_face);
twitter=(FloatingActionButton)findViewById(R.id.fab_twitter);
youtube=(FloatingActionButton)findViewById(R.id.fab_youtube);
facebook.setOnClickListener(this);
twitter.setOnClickListener(this);
youtube.setOnClickListener(this);
fabMenu.setOnFloatingActionsMenuUpdateListener(new FloatingActionsMenu.OnFloatingActionsMenuUpdateListener() {
@Override
public void onMenuExpanded() {
// frameLayout.getBackground().setAlpha(240);
frameLayout.setEnabled(false);
frameLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
fabMenu.collapse();
return true;
}
});
}
@Override
public void onMenuCollapsed() {
// frameLayout.getBackground().setAlpha(0);
frameLayout.setOnTouchListener(null);
}
});*/
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
EditText tcknArea = (EditText) findViewById(R.id.editText_tc);
String tckn = tcknArea.getText().toString().trim();
EditText nameArea = (EditText) findViewById(R.id.editText_isim);
String name = nameArea.getText().toString().trim();
EditText surnameArea = (EditText) findViewById(R.id.editText_soyisim);
String surname = surnameArea.getText().toString().trim();
Spinner birthDateSpinner = (Spinner) findViewById(R.id.birthDateSpinner);
String year = birthDateSpinner.getSelectedItem().toString();
if (checkInternetConnection()) {
if (name.isEmpty() || surname.isEmpty() || tckn.isEmpty()) {
Toast.makeText(Dogrudanyazin.this, "Lütfen gerekli alanları doldurunuz", Toast.LENGTH_SHORT).show();
} else {
new controlTCKNService().execute(tckn, name, surname, year);
}
} else {
Toast.makeText(Dogrudanyazin.this, "Lütfen internet bağlantınızı kontrol ediniz", Toast.LENGTH_SHORT).show();
}
email = "enhesapliburda@gmail.com";
gonderenemail = emailEdit.getText().toString();
name = nameEdit.getText().toString();
surname = surnameEdit.getText().toString();
subject = subjectEdit.getText().toString();
message = messageEdit.getText().toString();
tckn = tcEdit.getText().toString();
tel = telEdit.getText().toString();
if (!isValidEmail(gonderenemail) || gonderenemail.isEmpty() || name.isEmpty() || surname.isEmpty() || subject.isEmpty() || message.isEmpty() || tckn.isEmpty() || tel.isEmpty()) {
final String gonderenemail = emailEdit.getText().toString();
if (!isValidEmail(gonderenemail)) {
emailEdit.setError("Lütfen geçerli bir mail adresi giriniz!");
}
if (telEdit.getText().toString().length() < 10 || tel.length() > 13 || tel.matches(regexStr) == false) {
telEdit.setError("Lütfen telefon numaranızı düzgün giriniz!");
// am_checked=0;
}
Snackbar.make(arg0, "Tüm alanları doğru bir şekilde doldurunuz!", Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else if (isNetworkAvailable() == false) {
Snackbar.make(arg0, "Bir hata oluştu! Lütfen internet bağlantınızı kontrol edip tekrar deneyiniz..", Snackbar.LENGTH_LONG).setAction("Action", null).show();
} else {
message = message + "\n\n\n\n" + "Gönderen e-mail: " + gonderenemail + "\n\n\n" + " Gönderen kişinin adı:" + name + "\n\n" + "Gönderen kişinin soyadı:" + surname + "\n\n" + "T.C Kimlik Numarası:" + tckn + "\n" + " Telefon Numarası:" + tel;
sendMail(email, subject, message);
nameEdit.setText("");
surnameEdit.setText("");
emailEdit.setText("");
subjectEdit.setText("");
messageEdit.setText("");
tcEdit.setText("");
telEdit.setText("");
}
}
});
}
private static final String NAMESPACE = "http://tckimlik.nvi.gov.tr/WS";
private static final String URL = "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL";
private static final String SOAP_ACTION = "http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula";
private static final String METHOD_NAME = "TCKimlikNoDogrula";
public void controlTCKN (View view) {
EditText tcknArea = (EditText) findViewById(R.id.editText_tc);
String tckn = tcknArea.getText().toString().trim();
EditText nameArea = (EditText) findViewById(R.id.editText_isim);
String name = nameArea.getText().toString().trim();
EditText surnameArea = (EditText) findViewById(R.id.editText_soyisim);
String surname = surnameArea.getText().toString().trim();
Spinner birthDateSpinner = (Spinner) findViewById(R.id.birthDateSpinner);
String year = birthDateSpinner.getSelectedItem().toString();
if(checkInternetConnection()){
if(name.isEmpty() || surname.isEmpty() || tckn.isEmpty()){
Toast.makeText(Dogrudanyazin.this,"Lütfen gerekli alanları doldurunuz", Toast.LENGTH_SHORT).show();
}else {
new controlTCKNService().execute(tckn, name, surname, year);
}
} else {
Toast.makeText(Dogrudanyazin.this,"Lütfen internet bağlantınızı kontrol ediniz", Toast.LENGTH_SHORT).show();
}
}
private boolean checkInternetConnection() {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
boolean result = false;
// test for connection
if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isAvailable() && cm.getActiveNetworkInfo().isConnected()) {
result = true;
} else {
result = false;
}
return result;
}
public void clearFields (View view) {
EditText tcknArea = (EditText) findViewById(R.id.editText_tc);
EditText nameArea = (EditText) findViewById(R.id.editText_isim);
EditText surnameArea = (EditText) findViewById(R.id.editText_soyisim);
Spinner birthDateSpinner = (Spinner) findViewById(R.id.birthDateSpinner);
tcknArea.setText("");
nameArea.setText("");
surnameArea.setText("");
birthDateSpinner.setSelection(0);
}
public void aboutTCKN(View view){
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle(R.string.about_app);
alertDialog.setMessage("Bu uygulama T.C. Nüfus ve Vatandaşlık İşleri Genel Müdürlüğü tarafından kullanıma sunulan web servisi üzerinden doğrulama yapmaktadır.");
alertDialog.setButton("Tamam", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//here you can add functions
} });
alertDialog.show();
}
private class controlTCKNService extends AsyncTask<String, Void, Void> {
private String resultText;
private boolean result;
private ProgressDialog progressDialog = new ProgressDialog(Dogrudanyazin.this);
private AlertDialog.Builder builder = new AlertDialog.Builder(Dogrudanyazin.this);
AlertDialog alert;
protected void onPreExecute() {
progressDialog.setMessage("Kontrol ediliyor...");
progressDialog.show();
}
protected Void doInBackground(String... urls) {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
Request.addProperty("TCKimlikNo",urls[0]);
Request.addProperty("Ad", urls[1].toUpperCase());
Request.addProperty("Soyad", urls[2].toUpperCase());
Request.addProperty("DogumYili", urls[3]);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(Request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.bodyIn;
result = Boolean.parseBoolean( response.getProperty(0).toString());
if(result) {
resultText = getString(R.string.result_tckn_valid);
}else{
resultText = getString(R.string.result_tckn_invalid);
}
}
catch(ClassCastException e)
{
result = false;
resultText = getString(R.string.result_tckn_invalid);
}
catch(ConnectException e)
{
result = false;
resultText = getString(R.string.result_connection_error);
}
catch (UnknownHostException e) {
result = false;
resultText = getString(R.string.result_connection_error);
}
catch (UnknownServiceException e) {
result = false;
resultText = getString(R.string.result_connection_error);
}
catch(Exception e)
{
result = false;
resultText = getString(R.string.result_unknown_error)+e.toString();
}
return null;
}
protected void onPostExecute(Void unused) {
progressDialog.dismiss();
alert = builder.setMessage(resultText)
.setCancelable(true)
.setTitle("Sonuç")
.setPositiveButton("Tamam", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// MyActivity.this.finish();
}
}).create();
alert.show();
}
}
// validating email id
public static boolean isValidEmail(String email) {
Pattern pattern = Pattern.compile("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
"\\@" +
"[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
"(" +
"\\." +
"[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
")+");
Matcher matcher = pattern.matcher(email);
if (matcher.matches())
{
String country_code = email.substring(email.lastIndexOf(".")+1);
if(country_code.length() >= 2)
return true;
}
return false;
}
// validating email id
/* private boolean isValidName(String name) {
String USERNAME_PATTERN = "[a-zA-Z0-9]{1,250}";
Pattern pattern = Pattern.compile(USERNAME_PATTERN);
Matcher matcher = pattern.matcher(name);
return matcher.matches();
}*/
private void sendMail(String email, String subject, String messageBody) {
Session session = createSessionObject();
try {
javax.mail.Message message = createMessage(email, subject, messageBody, session);
new SendMailTask().execute(message);
} catch (AddressException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
private javax.mail.Message createMessage(String email, String subject, String messageBody, Session session) throws MessagingException, UnsupportedEncodingException {
javax.mail.Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("enhesapliburda@gmail.com", name));
message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(email, email));
message.setSubject(subject);
message.setText(messageBody);
InternetAddress internetAddress = new InternetAddress(email);
internetAddress.validate();
return message;
}
private Session createSessionObject() {
Properties properties = new Properties();
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.host", "smtp.gmail.com");
properties.put("mail.smtp.debug", "true");
properties.put("mail.smtp.socketFactory.fallback", "false");
properties.put("mail.smtp.port", "587");
return Session.getInstance(properties, new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
/* @Override
public void onClick(View v) {
switch (v.getId()){
case R.id.fab_face:
openBrowser("https://www.facebook.com/TurkcellGelecegiYazanlar");
break;
case R.id.fab_twitter:
openBrowser("https://twitter.com/GelecegiYazanlr");
break;
case R.id.fab_youtube:
openBrowser("https://www.youtube.com/channel/UCt03q1RpC8Jrifo88diQXnA");
break;
}
}
public void openBrowser(String url){
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}*/
private class SendMailTask extends AsyncTask<javax.mail.Message, Void, Void> {
private String resultText;
private boolean result;
@Override
protected void onPreExecute() {
super.onPreExecute();
Toast.makeText(getApplication(), "Mail gönderiliyor...", Toast.LENGTH_SHORT).show();
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
Toast.makeText(getApplication(), "Mailiniz başarıyla gönderilmişir...", Toast.LENGTH_SHORT).show();
}
@Override
protected Void doInBackground(javax.mail.Message... messages) {
try {
Transport.send(messages[0]);
} catch (MessagingException e) {
e.printStackTrace();
}
return null;
}
}
public boolean isNetworkAvailable()
{
boolean connected = false;
ConnectivityManager connectivityManager =
(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if(connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState()
== NetworkInfo.State.CONNECTED ||
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState()
== NetworkInfo.State.CONNECTED) {
//we are connected to a network
connected = true;
}
else
connected = false;
return connected;
}
}
Float Action Menü Öğelerine tıklayınca yeni aktivity açma
Bu resimdeki sol üst köşedeki float action buttonu projemde kullandım buraya kadar herşey güzel yalnız ben o papatya yapraklarına benziyen menü elemanlarının herbirine ayrı birer activity atamak istiyorum bu mümkün mü? Mümkünse bunu nasıl yapabilirim yani bir activitye nasıl bağlantı verebilirim? Aşağıda kod parçacığımı gönderdim nasıl bir ekleme yapılması gerekiyor yardımcı olan olursa çok sevinirim.
package info.androidhive.materialdesign;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionButton;
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu;
import com.oguzdev.circularfloatingactionmenu.library.SubActionButton;
import info.androidhive.mardinvalilik.R;
import info.androidhive.mardinvalilik.activity.Lan;
@SuppressWarnings("ALL")
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
// Set up the large red button on the center right side
// With custom button and content sizes and margins
int redActionButtonSize = getResources().getDimensionPixelSize(R.dimen.kırmızı_butonun_pixel_boyutu); //Kırmızı butonun pixel boyutu
int redActionButtonMargin = getResources().getDimensionPixelOffset(R.dimen.action_button_margin); //Kırmızı butonun kenar pixel boyutu
int redActionButtonContentSize = getResources().getDimensionPixelSize(R.dimen.action_button_size);//Kırmızı butonun içindeki nesnenin pixel boyutu
int redActionButtonContentMargin = getResources().getDimensionPixelSize(R.dimen.action_button_size);//Kırmızı butonun içindeki nesnenin kenar pixel boyutu
int redActionMenuRadius = getResources().getDimensionPixelSize(R.dimen.action_button_size);//Menünün yarı çapı
int blueSubActionButtonSize = getResources().getDimensionPixelSize(R.dimen.action_button_size);// Menü elemanlarının buton boyutu
int blueSubActionButtonContentMargin = getResources().getDimensionPixelSize(R.dimen.action_button_size);//Menü elemanlarının içindeki nesnenin pixel boyutu
ImageView fabIconStar = new ImageView(this);
fabIconStar.setImageDrawable(getResources().getDrawable(R.drawable.ic_profile));
FloatingActionButton.LayoutParams starParams = new FloatingActionButton.LayoutParams(redActionButtonSize, redActionButtonSize);
starParams.setMargins(redActionButtonMargin,
redActionButtonMargin,
redActionButtonMargin,
redActionButtonMargin);
fabIconStar.setLayoutParams(starParams);
FloatingActionButton.LayoutParams fabIconStarParams = new FloatingActionButton.LayoutParams(redActionButtonContentSize, redActionButtonContentSize);
fabIconStarParams.setMargins(redActionButtonContentMargin,
redActionButtonContentMargin,
redActionButtonContentMargin,
redActionButtonContentMargin);
final FloatingActionButton leftCenterButton = new FloatingActionButton.Builder(this)
.setContentView(fabIconStar, fabIconStarParams)
.setBackgroundDrawable(R.drawable.fab_background)
.setPosition(FloatingActionButton.POSITION_BOTTOM_CENTER)
.setLayoutParams(starParams)
.build();
// Set up customized SubActionButtons for the right center menu
SubActionButton.Builder lCSubBuilder = new SubActionButton.Builder(this);
lCSubBuilder.setBackgroundDrawable(getResources().getDrawable(R.drawable.button_action_dark_selector));
FrameLayout.LayoutParams blueContentParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
blueContentParams.setMargins(blueSubActionButtonContentMargin,
blueSubActionButtonContentMargin,
blueSubActionButtonContentMargin,
blueSubActionButtonContentMargin);
lCSubBuilder.setLayoutParams(blueContentParams);
// Set custom layout params
FrameLayout.LayoutParams blueParams = new FrameLayout.LayoutParams(blueSubActionButtonSize, blueSubActionButtonSize);
lCSubBuilder.setLayoutParams(blueParams);
ImageView lcIcon1 = new ImageView(this);
ImageView lcIcon2 = new ImageView(this);
ImageView lcIcon3 = new ImageView(this);
ImageView lcIcon4 = new ImageView(this);
ImageView lcIcon5 = new ImageView(this);
lcIcon1.setImageDrawable(getResources().getDrawable(R.drawable.button_action_dark));
lcIcon2.setImageDrawable(getResources().getDrawable(R.drawable.button_action_dark));
lcIcon3.setImageDrawable(getResources().getDrawable(R.drawable.button_action_dark));
lcIcon4.setImageDrawable(getResources().getDrawable(R.drawable.button_action_dark));
lcIcon5.setImageDrawable(getResources().getDrawable(R.drawable.button_action_dark));
// Build another menu with custom options
final FloatingActionMenu leftCenterMenu = new FloatingActionMenu.Builder(this)
.addSubActionView(lCSubBuilder.setContentView(lcIcon1, blueContentParams).build())
.addSubActionView(lCSubBuilder.setContentView(lcIcon2, blueContentParams).build())
.addSubActionView(lCSubBuilder.setContentView(lcIcon3, blueContentParams).build())
.addSubActionView(lCSubBuilder.setContentView(lcIcon4, blueContentParams).build())
.addSubActionView(lCSubBuilder.setContentView(lcIcon5, blueContentParams).build())
.setRadius(redActionMenuRadius)
.setStartAngle(150)
.setEndAngle(-150)
.attachTo(leftCenterButton)
.build();
Webview Video Oynatma Sorunu
ben uygulamamda webvievde video oynatmak istiyorum faat bullduğum iki tane örnekte java dosyalarını entegre ederlen mesela mainde framelayouy içerisinde video oynatması için gereken kodları yani layoutu maine entege edemiyorum çalışmıyor main kalabalık biraz webivevim swiperefreshlayout içerisinde olduğu için videonun açılacağı layoutun yerini ayarlayamıyorum nasıl yapabiirim. Bu ara darawer layout kullanıyorum ve main activitim Activity ye değil AppCompactActivity ye extendli