Browsing "Older Posts"

Browsing Category "Tutorials"

How to Enable / Disable XAMPP mod_rewrite

By James → Thursday, August 11, 2016
For any reason if you need to disable/enable XAMPP mod_rewrite (Enabled by default) , then below are the instructions on how to enable .htaccess mod_rewrite in XAMPP.
1. Go to the directory of installation C:\xampp\apache\conf (default) or your installation directory:\xampp\apache\conf
2. Open and edit httpd.conf in a text editor
3. To  disable find the line which contains
LoadModule rewrite_module modules/mod_rewrite.so
and (comment) change to
#LoadModule rewrite_module modules/mod_rewrite.so
4. Find all occurrences of
AllowOverride All
and change to
AllowOverride None
I think it appears 2 or 3 times on the configuration file.
5. Restart xampp
That’s it , Now mod_rewrite is disabled. To enable it just follow the instruction in reverse order.

Android getDrawable() deprecated API 22 Alternative

By James →
There are several options to handle getDrawable() deprecation (the right and future proof way), depending on which kind of drawable is being loaded:
A) Drawables without theme attributes
ResourcesCompat.getDrawable(getResources(), R.drawable.name, null);
For unstyled drawable the old way. This is probably what is needed.
Please note:  ResourcesCompat.getDrawable()  is not deprecated!
B) Drawables with theme attributes
ContextCompat.getDrawable(getActivity(), R.drawable.name);
For a styled Drawable as the Activity theme instructs.
C) Drawables with theme attributes from another theme
ResourcesCompat.getDrawable(getResources(), R.drawable.name, anotherTheme);
Explanation:
Android 21 (5.0 Lollipop) introduced some new theme attributes such as android:colorAccent that modify the appearance of drawables that hold references to those new theme attributes values.
The AppCompat library handles pre and post-Lollipop drawable styling for you.
If the deprecated getDrawable() method is used to obtain a drawable resource with theme attributes, A partially-styled drawable and a logcat warning will come as output. It can be seen in API 22 android.content.res.Resources source code:
@Deprecated
@Nullable
public Drawable getDrawable(int id) throws NotFoundException {
final Drawable d = getDrawable(id, null);
if (d != null && d.canApplyTheme()) {
Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme "
+ "attributes! Consider using Resources.getDrawable(int, Theme) or "
+ "Context.getDrawable(int).", new RuntimeException());
}
return d;
}

Enable Android MTP and Media Player Windows 10

By James →
By default Android MTP and Windows Media Player is not enabled in Windows 10. For this reason whenever you connect a android device in Windows 10 it will not show your device in the Windows Explorer. If you want to enable Android MTP as well as want back the Windows Media Player in Windows 10 then You have to enable them manually. To do so you have to follow the following steps.
  1. Go to this Link.
  2. Select Your Language.
  3. Click the Download Button.
  4. Select the appropriate file according to your Windows System Type (
    KB3099229_x86.msu for 32bit or
    KB3099229_x64.msu for 64 bit  Windows System ).
  5. If you don't know your Windows System type then follow this Tutorial otherwise skip to Step 6.
  6. Open the .msu file.
  7. Follow the instructions of the installer.
  8. After completing installation restart your computer.
  9. All done. Now you can connect your Android phones as well as use Windows Media Player.

How to take back the e-mail that was sent by mistake (Gmail)

By James → Friday, April 22, 2016
After clicking the Send button if you think that there was a mistake in the email and now you want to undo send or delete the mail. If you are a Gmail user, then you can get at least a little bit of time to get back the message that you have sent. 'Undo Send' is a feature of Gmail that gives the  facility to stop/delete mistaken e-mail  immediately after cliking send button. Gmail Lab have included this feature six years ago, but it was experimental. However, If you want to activate this feature, then follow the steps below.

Gmail Sign (login).
Click the gear icon in the upper right hand corner of the screen.
Select Settings.
Go to the Undo Send part under General tab.
Click Enable Undo Send-.
Select duration from the list.
By clicking on the Save Changes button located at bottom of the screen save the new settings.
From now each time after sending an e-mail  you will see the "Undo button" next to the text "Your message has been sent".