Popular questions for this item

why my ../admin/dashboard not found ?

you need to config your .htaccess file, if you upload all file in cms direct to public_html like that ../public_html/all_file… . You need config .htaccess like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

if you upload cms as subfolder of public_html file as public_html/cms, you need config .htaccess file like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cms/index.php?/$1 [L]

call and sms function call to owner of post in 1.0.3 version

sorry because my confuse, i will update fix in few day but you can quick fix by replace detailActivity.java code with this code

package com.bk.lrandom.droidmarket; import java.io.File; import java.util.ArrayList;

import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.TunnelRefusedException; import org.apache.http.util.EntityUtils; import org.json.JSONArray; import org.json.JSONObject; import com.bk.lrandom.droidmarket.business.JSONFetchTask; import com.bk.lrandom.droidmarket.business.RoundedAvatarDrawable; import com.bk.lrandom.droidmarket.business.Ultils; import com.bk.lrandom.droidmarket.business.UserSessionManager; import com.bk.lrandom.droidmarket.confs.constants; import com.bk.lrandom.droidmarket.fragments.DetailContentFragment; import com.bk.lrandom.droidmarket.models.Products; import com.bk.lrandom.droidmarket.models.User; import com.koushikdutta.async.future.FutureCallback; import com.koushikdutta.ion.Ion; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.preference.DialogPreference; import android.support.v7.app.ActionBarActivity; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast;

@SuppressLint(“NewApi”) public class DetailActivity extends ActionBarParentActivity { TextView fullName, address, dateUpdated, phone, price, title, currency; ImageView avt; ProgressDialog dialog; public static final String IMAGES_RESPONSE = “images_feed”; ArrayList<String> paths; int product_id; String user_id; ImageButton btnEmail, btnSMS, btnCall; String email, phoneText; EditText message; User logedUser; Button btnRateIt; TextView rating; }

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.detail_layout);
    fullName = (TextView) findViewById(R.id.full_name);
    address = (TextView) findViewById(R.id.address);
    price = (TextView) findViewById(R.id.price);
    title = (TextView) findViewById(R.id.title);
    avt = (ImageView) findViewById(R.id.avt);
    dateUpdated = (TextView) findViewById(R.id.date_updated);
    currency = (TextView) findViewById(R.id.currency);
    btnEmail = (ImageButton) findViewById(R.id.btnEmail);
    btnSMS = (ImageButton) findViewById(R.id.btnSmS);
    btnCall = (ImageButton) findViewById(R.id.btnPhone);
    btnRateIt = (Button) findViewById(R.id.btn_rate_it);
    rating = (TextView) findViewById(R.id.rating);
    btnRateIt.setOnClickListener(new View.OnClickListener() {
}
@Override
    public void onClick(View v) {
        if (!Ultils.isConnectingToInternet(DetailActivity.this)) {
            showMsg(getResources().getString(R.string.open_network));
            return;
        }
        UserSessionManager userSession = new UserSessionManager(
                DetailActivity.this);
        if (userSession.getUserSession() == null) {
            Intent intent = new Intent(DetailActivity.this,
                    AuthenticationActivity.class);
            startActivity(intent);
        } else {
            final ProgressDialog dialogPrg = new ProgressDialog(
                    DetailActivity.this);
            dialogPrg.setCanceledOnTouchOutside(false);
            logedUser = userSession.getUserSession();
            final Dialog rankDialog = new Dialog(DetailActivity.this);
            rankDialog.setContentView(R.layout.rating_layout);
            rankDialog.setCancelable(true);
            final RatingBar ratingBar = (RatingBar) rankDialog
                    .findViewById(R.id.dialog_ratingbar);
            Button updateButton = (Button) rankDialog
                    .findViewById(R.id.rank_dialog_button);
            updateButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialogPrg.show();
                    new Thread(new Runnable() {
});
@Override
                    public void run() {
}
// TODO Auto-generated method stub
                    String handleInserUrl = getResources()
                            .getString(
                                    R.string.products_json_url)
                            + "rate";
                    try {
                        HttpClient client = new DefaultHttpClient();
                        HttpPost post = new HttpPost(
                                handleInserUrl);
                        MultipartEntity reqEntity = new MultipartEntity();
                        reqEntity.addPart(
                                "user_id",
                                new StringBody(logedUser
                                        .getId() + ""));
                        reqEntity
                                .addPart(
                                        "product_id",
                                        new StringBody(
                                                product_id + ""));
                        reqEntity.addPart(
                                "point",
                                new StringBody(ratingBar
                                        .getRating() + ""));
}
post.setEntity(reqEntity);
                    HttpResponse response = client
                            .execute(post);
                    HttpEntity resEntity = response
                            .getEntity();
                    final String response_str = EntityUtils
                            .toString(resEntity);
                    if (resEntity != null) {
                        Log.i("RESPONSE_DETAIL",
                                response_str);
                        runOnUiThread(new Runnable() {
                            public void run() {
                                try {
                                    dialogPrg.dismiss();
                                    rankDialog.dismiss();
                                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                                        new JSONFetchTask(
                                                getResources()
                                                        .getString(
                                                                R.string.products_json_url)
                                                        + "avg_rate/product_id/" 
                                                        + product_id,
                                                handlerRate,
                                                "rate")
                                                .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
                                    } else {
                                        new JSONFetchTask(
                                                getResources()
                                                        .getString(
                                                                R.string.products_json_url)
                                                        + "avg_rate/product_id/" 
                                                        + product_id,
                                                handlerRate,
                                                "rate")
                                                .execute();
                                    }
});
rankDialog.show();
} catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    });
                }
            } catch (Exception ex) {
                Log.e("Debug",
                        "error: " + ex.getMessage(), ex);
            }
        }
    }).start();
    rankDialog.dismiss();
}
if (getIntent().getExtras() != null
        && getIntent().getExtras().containsKey(constants.COMMON_KEY)) {
    product_id = getIntent().getExtras().getInt(constants.COMMON_KEY);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        new JSONFetchTask(getResources().getString(
                R.string.products_json_url)
                + "products?product_id=" + product_id, handler)
                .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    } else {
        new JSONFetchTask(getResources().getString(
                R.string.products_json_url)
                + "products?product_id=" + product_id, handler)
                .execute();
    }
}
dialog = new ProgressDialog(this);
dialog.setMessage(getResources().getString(R.string.loading));
dialog.setCanceledOnTouchOutside(false);
dialog.show();
paths = new ArrayList<String>();
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle(getResources().getString(R.string.detail_label));
loadAd();
public static final String TAG = "DetailActivity";
Handler handler = new Handler() {
    public void handleMessage(android.os.Message msg) {
        Bundle bundle = msg.getData();
        if (bundle.containsKey(JSONFetchTask.KEY_RESPONSE)) {
            dialog.dismiss();
            String jsonString = bundle
                    .getString(JSONFetchTask.KEY_RESPONSE);
            try {
                JSONArray jsonArray = new JSONArray(jsonString);
                if (jsonArray.length() == 1) {
                    JSONObject obj = jsonArray.getJSONObject(0);
                    parseProduct(obj);
                }
            } catch (Exception e) {
                Log.e(TAG, "error parse");
                // TODO: handle exception
            }
        }
    };
};
Handler handlerRate = new Handler() {
    public void handleMessage(android.os.Message msg) {
        Bundle bundle = msg.getData();
        if (bundle.containsKey("rate")) {
            dialog.dismiss();
            String jsonString = bundle.getString("rate");
            try {
                JSONObject jsonObject = new JSONObject(jsonString);
                String ratingText = jsonObject.getString("rating");
                rating.setText(getResources().getString(R.string.rating)
                        + " : " + ratingText);
            } catch (Exception e) {
                Log.e(TAG, "error parse image");
                // TODO: handle exception
            }
        }
    };
};
Handler handlerImages = new Handler() {
    public void handleMessage(android.os.Message msg) {
        Bundle bundle = msg.getData();
        if (bundle.containsKey(IMAGES_RESPONSE)) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                new JSONFetchTask(getResources().getString(
                        R.string.products_json_url)
                        + "avg_rate/product_id/" + product_id, handlerRate,
                        "rate")
                        .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
            } else {
                new JSONFetchTask(getResources().getString(
                        R.string.products_json_url)
                        + "avg_rate/product_id/" + product_id, handlerRate,
                        "rate").execute();
            }
            String jsonString = bundle.getString(IMAGES_RESPONSE);
            try {
                int photoID[] = { R.id.photo_1, R.id.photo_2, R.id.photo_3 };
                JSONArray jsonArray = new JSONArray(jsonString);
                for (int i = 0; i < jsonArray.length(); i++) {
                    JSONObject jsonObj = jsonArray.getJSONObject(i);
                    String path = getResources().getString(
                            R.string.domain_url)
                            + jsonObj.getString("path");
                    ImageView photo = (ImageView) findViewById(photoID[i]);
                    photo.setTag(i);
                    Ion.with(DetailActivity.this, path).withBitmap()
                            .resize(256, 256).centerCrop()
                            .placeholder(R.drawable.no_photo)
                            .error(R.drawable.no_photo)
                            .intoImageView(photo);
                    paths.add(path);
                    photo.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            v.getTag();
                            // TODO Auto-generated method stub
                            Intent intent = new Intent(DetailActivity.this,
                                    ImagePreviewActivity.class);
                            intent.putStringArrayListExtra(
                                    constants.IMAGES_PATH, paths);
                            int pos = (Integer) v.getTag();
                            intent.putExtra(constants.IMAGE_POSITION, pos);
                            startActivity(intent);
                        }
                    });
                }
            } catch (Exception e) {
                // TODO: handle exception
                e.printStackTrace();
                Log.e(TAG, "parse error");
            }
};
}
};
public void parseProduct(JSONObject jsonObj) {
    try {
        // int id = jsonObj.getInt(Products.TAG_ID);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            new JSONFetchTask(getResources().getString(
                    R.string.images_json_url)
                    + "images/product_id/" + product_id, handlerImages,
                    IMAGES_RESPONSE)
                    .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        } else {
            new JSONFetchTask(getResources().getString(
                    R.string.images_json_url)
                    + "images/product_id/" + product_id, handlerImages,
                    IMAGES_RESPONSE).execute();
        }
        String fullNameText = jsonObj.getString(User.TAG_USER_NAME);
        fullName.setText("@" + fullNameText);
        fullName.setOnClickListener(new View.OnClickListener() {
}
@Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(DetailActivity.this,
                    ProfileActivity.class);
            intent.putExtra(constants.COMMON_KEY, user_id);
            startActivity(intent);
        }
    });
    user_id = jsonObj.getString("user_id");
    email = jsonObj.getString("email");
    phoneText = jsonObj.getString("phone");
    Log.i(TAG, email);
    btnSMS.setOnClickListener(new View.OnClickListener() {
} catch (Exception e) {
    // TODO: handle exception
    e.printStackTrace();
}
@Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        if (!Ultils.isConnectingToInternet(DetailActivity.this)) {
            showMsg(getResources().getString(R.string.open_network));
            return;
        }
UserSessionManager userSession = new UserSessionManager(
            DetailActivity.this);
}
if (userSession.getUserSession() == null) {
    Intent intent = new Intent(DetailActivity.this,
            AuthenticationActivity.class);
    startActivity(intent);
} else {
    if (phoneText == null || phoneText.equals("")) {
        showDialog(getResources().getString(
                R.string.this_user_not_share_phone_number));
    } else {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri
                .parse("sms:" + phoneText)));
    }
}
});
btnCall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    if (!Ultils.isConnectingToInternet(DetailActivity.this)) {
        showMsg(getResources().getString(R.string.open_network));
        return;
    }
}
UserSessionManager userSession = new UserSessionManager(
        DetailActivity.this);
if (userSession.getUserSession() == null) {
    Intent intent = new Intent(DetailActivity.this,
            AuthenticationActivity.class);
    startActivity(intent);
} else {
    if (phoneText == null || phoneText.equals("")) {
        showDialog(getResources().getString(
                R.string.this_user_not_share_phone_number));
    } else {
        startActivity(new Intent(Intent.ACTION_CALL, Uri
                .parse("tel:" + phoneText)));
    }
}
});
btnEmail.setOnClickListener(new View.OnClickListener() {
});
@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    if (!Ultils.isConnectingToInternet(DetailActivity.this)) {
        showMsg(getResources().getString(R.string.open_network));
        return;
    }
UserSessionManager userSession = new UserSessionManager(
        DetailActivity.this);
if (userSession.getUserSession() == null) {
    Intent intent = new Intent(DetailActivity.this,
            AuthenticationActivity.class);
    startActivity(intent);
} else {
    logedUser = userSession.getUserSession();
    if (logedUser.getId() == Integer.parseInt(user_id)) {
        showDialog(getResources().getString(
                R.string.enquiry_alert));
        return;
    }
}
LayoutInflater inflater = LayoutInflater
        .from(DetailActivity.this);
View promptsView = inflater.inflate(
        R.layout.enquiry_prompts_layout, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
        DetailActivity.this);
// set prompts.xml to alertdialog builder
alertDialogBuilder.setView(promptsView);
message = (EditText) promptsView
        .findViewById(R.id.editTextDialogUserInput);
alertDialogBuilder.setMessage(getResources().getString(
        R.string.send_enquiry));
// set dialog message
alertDialogBuilder
        .setCancelable(false)
        .setPositiveButton(
                getResources().getString(
                        R.string.ok_label),
                new DialogInterface.OnClickListener() {
                    public void onClick(
DialogInterface dialog, int id) {
                if (message.getText()
                        .toString()
                        .equalsIgnoreCase("")) {
                    showDialog(getResources()
                            .getString(
                                    R.string.type_message));
                    return;
                }
                new SendEnquiry().execute();
            }
        })
.setNegativeButton(
        getResources().getString(
                R.string.cancel_label),
        new DialogInterface.OnClickListener() {
            public void onClick(
                    DialogInterface dialog,
                    int id) {
                dialog.cancel();
            }
        });
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
String titleText = jsonObj.getString(Products.TAG_TITLE);
title.setText(titleText);
String addressText = jsonObj.getString("county_name") + " - " 
        + jsonObj.getString("cities_name");
address.setText(addressText);
currency.setText(" " + jsonObj.getString(Products.TAG_CURRENCY));
String priceText = jsonObj.getString(Products.TAG_PRICE);
if (priceText != null && !priceText.equalsIgnoreCase("")) {
    price.setText(priceText);
} else {
    price.setText(" " 
            + getResources().getString(R.string.negotiate_label));
}
dateUpdated.setText(jsonObj.getString("updated_at"));
String fbId = jsonObj.getString(User.TAG_FB_ID);
String avtPath = jsonObj.getString(User.TAG_AVT);
if (avtPath != null && !avtPath.equalsIgnoreCase("")) {
    Log.i(TAG, "Khac null");
    String avtString = "";
    if (Ultils.checkFacebookAvt(avtPath)) {
        avtString = avtPath;
    } else {
        avtString = getResources().getString(R.string.domain_url)
                + avtPath;
    }
    Ion.with(DetailActivity.this, avtString).withBitmap()
            .resize(200, 200).centerCrop()
            .placeholder(R.drawable.ic_avatar)
            .error(R.drawable.ic_avatar).asBitmap()
            .setCallback(new FutureCallback<Bitmap>() {
@Override
    public void onCompleted(Exception arg0,
            Bitmap bitmap) {
        // TODO Auto-generated
        // method stub
        if (bitmap != null) {
            RoundedAvatarDrawable avtDrawable = new RoundedAvatarDrawable(
                    bitmap);
            avt.setImageDrawable(avtDrawable);
        }
    }
});
}
String content = jsonObj.getString(Products.TAG_CONTENT);
DetailContentFragment fragment = DetailContentFragment
        .newInstance();
Bundle bundle = new Bundle();
bundle.putString(DetailContentFragment.DETAIL_KEY, content);
fragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction()
        .replace(R.id.content, fragment).commit();
private class SendEnquiry extends AsyncTask<Void, Void, Boolean> {
};
public SendEnquiry() {
    // TODO Auto-generated constructor stub
}
@Override
protected void onCancelled() {
    // TODO Auto-generated method stub
    super.onCancelled();
    dialog.dismiss();
}
protected void onPostExecute() {
    dialog.dismiss();
};
@Override
protected void onPreExecute() {
    // TODO Auto-generated method stub
    super.onPreExecute();
    dialog = new ProgressDialog(DetailActivity.this);
    dialog.setMessage(DetailActivity.this.getResources().getString(
            R.string.please_wait_msg));
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
}
@Override
protected Boolean doInBackground(Void... params) {
    // TODO Auto-generated method stub
    String handleInserUrl = getResources().getString(
            R.string.users_json_url)
            + "send_enquiry";
    try {
        HttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost(handleInserUrl);
        MultipartEntity reqEntity = new MultipartEntity();
        reqEntity.addPart("email", new StringBody(email));
        reqEntity.addPart("message", new StringBody(message.getText()
                .toString()));
        reqEntity.addPart("reply_to",
                new StringBody(logedUser.getEmail()));
        reqEntity.addPart("user_name",
                new StringBody(logedUser.getUserName()));
        post.setEntity(reqEntity);
        HttpResponse response = client.execute(post);
        HttpEntity resEntity = response.getEntity();
        final String response_str = EntityUtils.toString(resEntity);
        if (resEntity != null) {
            Log.i("RESPONSE", response_str);
            runOnUiThread(new Runnable() {
                public void run() {
                    try {
                        dialog.dismiss();
                        JSONObject jsonObj = new JSONObject(
                                response_str);
                        if (jsonObj.getString("ok").equals("0")) {
                            showDialog(getResources().getString(
                                    R.string.spam_msg));
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
        }
    } catch (Exception ex) {
        Log.e("Debug", "error: " + ex.getMessage(), ex);
    }
    return null;
}

facebook login work in debug mode but not work when export signed app

generate debug keyhash keytool -exportcert -alias androiddebugkey -keystore c:\Users\YourUser\.android\debug.keystore | openssl sha1 -binary | openssl base64

Because facebook use two sha1 key, one for debug and one for sha1 so when release app you need create and signed keyhash follow this

generate release keyhash keytool -exportcert -alias “yourAliasUsedWhenYouGeneratedTheKey” -keystore “C:\Users\YourUser\AppData\Local\Android\android-studio\key.jks” | openssl sha1 -binary | openssl base64

facebook login not work

when download openssl dont download lastest version, you should download e or d version of openssl

Show more

by
by
by
by
by
by