Google+

Saturday, 26 July 2014

How To use Xposed Framework and Modules?


               Android is truly a blessing for people who like to tinker with the look and feel of their phone. It can allow you to modify/customize your phone according to your needs or according to your liking. If you are bored of your plain screen or default launcher, you can experience change in the form of different launchers. And even in launchers you get lots of options like, if you want a launcher which is high on customisation and less in simplicity and speed than you got Themer & buzz launcher. If you want to go for simplicity and speed than you got nova launcher. In the same way you have launchers which gives you looks of Windows 8 or Android L. You can get launchers for practically all your likeness. 
           Not moving away from topic, level of customization depends on user's knowledge about android. If you are basic user than you got widgets, launchers, keyboards & wallpapers for your needs. But, if you have some sound knowledge of android and are not afraid to try new things than you have whole new world out there to use your expertise and customize your phone to your liking. If you have rooted your phone (If you don't know about rooting, than read my article about What do you mean by rooting an android) than there is practically anything you can do with your phone. You can install custom rom on your phone, you can customize its kernel, you can be the super user, you can install apps which will help you use your phone resources in a better way (lets take example of app like Greenify, which will stop your apps from using your phone's resources when they are no longer required and stay active in background. they will be stopped from sucking the juice out of your phone), 
        But now thanks to Rovo89 we will be able to use selected features of different custom rom on your rooted phone, which can be running on stock rom. Xposed framework will help you get all the features of custom rom in the form of modules. All the changes will be done on phone memory so reverting back to old state is also easy unlike custom roms. But beware, it will work only on ROOTED phone (P.S - It works in Dalvik runtime only, so people using ART please revert to Dalvik before activating xposed otherwise you might end up in bootloop). Best part of xposed is that it will allow user to use one module on another module. 

I am quoting the explanation given on repo.xposed.info for better understanding about the topic.
Xposed is a framework for modules that can change the behavior of the system and apps without touching any APKs. That's great because it means that modules can work for different versions and even ROMs without any changes (as long as the original code was not changed too much). It's also easy to undo. As all changes are done in the memory, you just need to deactivate the module and reboot to get your original system back. There are many other advantages, but here is just one more: Multiple modules can do changes to the same part of the system or app. With modified APKs, you to decide for one. No way to combine them, unless the author builds multiple APKs with different combinations.

How to install Xposed Framework?

You can download latest installer for xposed framework from this link. Install it as an .apk file


Just install it as a normal apk file.
After installing Xposed framework, you will get to see next screen which will let you know that xposed is not yet active as you haven't activated it yet and you have not yet given it super user access. That screen will look like the screen below..


First it will alert you by saying xposed might act little different for you.
 In second screen it is asking you for root access.
Next it will ask you to reboot your phone so as to activate the Xposed installer.
It will look like the fourth screen when it has been activated.

How to use Xposed Modules?

After activating Xposed framework and restarting your phone. When you open xposed framework you will need to go to download section, there you see xposed installed. And list of other modules, there find the modules you want.


Xposed activated. If you want to install any module for xposed framework, you need to go to download section, where you can search for your desired module and install it.

I am going to install GravityBox, In same way you can install any module you want. After searching for GravityBox I need to download and install it. And restart phone for module to get activated.


After searching for my desired module, i.e GravityBox in this case. I need to install it and than activate it by restarting it.

Want to see collection of Xposed modules? go to this XDA thread.
Want to know more about Xposed framework? go to this XDA thread.


Still have any doubts about Xposed frameworks or modules?
Comment below, will try my best to help you.
And yes special thanks to Rovo89 for giving us an option to use special feature from any rom on our stock rom itself. Such developers should always be encouraged.


Credits - repo.xposed.info

Friday, 7 March 2014

Android WebView Example | How to create WebView?

       Hello everybody, its been a while since I have blogged about something. Today I am not going to write about any Android app or Android tech, But today I will teach you about how to make an android app to show your own website. I know there exist many sites like appgeyser  which will let you create such types of apps, but if you want to learn to make android app than you need to start learning somewhere. So why not start with making of webView? P.S In simple language webView is used to show webpage. You can read about webView on android developer tools. And yes I would like to make one thing clear, I am not some big Android developer, Here I will be sharing in next few posts what I have learnt in last few months. Anyway will try to help you in all ways possible.

So lets stop talking and get to work.

To start Android App development you'll need Android Developer Tools. You can get here. All tools needed are already there on that site. You just have to download it. And how to set an Android Development Environment can be found here. Actually I was going to write about it in detail but then it was written in such an easy and simple way on Android Developer site that I thought that I won't be able to simplify it more and you can very well read it there [Links are very well provided].
  • So after you are done with setting up an environment, Start eclipse.
  • When you start eclipse, it will ask to load a workspace, If it would be your first time you can use default workspace or create your own.
  • After you have defined workspace, eclipse will load. Than go to file>new>project>Than select Android and than Android Application Project.
Screen will look like this..


  • Than new Screen will imerge which will ask you for Activity name, Application name, Package name and so on. (remember to write package name properly as, when you submit your app to android playstore, package name will be included in your app's URL)

  • Click Next on this screen without making any changes.

  • You can click Next in this screen too,  You can define your app icon here. But I skip it always as you can always add that later too.

  • Click Next in this screen too. It lets you create different types of activities like you want particular activity to start in full screen mode or master detail mode. But we will take blank activity for this app.

  • Next screen will ask you to write activity name and layout name. Write that name as you want or keep it unchanged. Click finish here and it will take you to our destination where we will start coding.


  • Than go to WebView > res > layout > layout file ( In my case it is main.xml) and paste following code.
<framelayout 
android:id="@+id/container" 
android:layout_height="match_parent" 
android:layout_width="match_parent" 
tools:context=".MainActivity" 
tools:ignore="MergeRootFrame" 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools">
         
<webview 
android:id="@+id/activity_main_webview" 
android:layout_height="match_parent" 
android:layout_width="match_parent"/>
</framelayout>
Your graphical layout will look something like this


  • Than we will need to write code in source folder. For that go to webView > src > in.droidgyaan (That's my activity name) 
  • Than paste following code

package in.droidgyaan;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.app.Activity;


public class MainActivity extends Activity {
    
    private WebView mWebView;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main); //Sets layout to main layout defined in res>layout>main
        mWebView = (WebView) findViewById(R.id.activity_main_webview); //finds webview by id we mentioned in main.xml
        //Enables JavaScript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true); //Sets javascript to true
        mWebView.setWebViewClient(new WebViewClient()); 
        mWebView.loadUrl("http://www.droidgyaan.in/?m=1"); //It loads website we mention here.
       
    }
}

  • Now you are ready with your first android app. But remember if you have made any changes to activity name after you made your project or midway somewhere, you will need to change activity name in manifest file too, otherwise your app won't run, it will give error. You'll need to add internet permission to manifest file to allow application to use internet. You can give access to internet by using following code in your manifest file.
<uses-permission android:name="android.permission.INTERNET"/>


  • Now after you are done with coding, you can make an .apk file to run it on your phone.by going to File > Export > Android > Export Android Application > Select project you want to export as apk file > Now select keystore > Now select keyalias > Now select destination folder to save your apk file. (Keystore is used to encrypt your app with particular key, you can use default keystore by going to C drive > Users > Select admin username > than go to .android > select debug.keystore. Password for it is android. This is debug key provided by Google. While releasing android app it is preferable to make your apk file by your own keystore. But remember to store your keystore as safely as possible because if you release an app on playstore with X keystore and than after sometime you want to release an update to your app than you have to use that same keystore as you used before otherwise it will be considered new app. So keep copy of that keystore at as many place you can. I would recommend save it on cloud. Make your own keyalias too along with keystore).

Now we are done with our first Android App Development tutorial. Hope it is helpful to you.

You can download source code for this project from my Github, Click here to download.


If you have any questions fire it up in comment section below. I will try to solve it somehow.


Tuesday, 17 December 2013

Why should you buy a Nexus device?

    




  •  There may be time when you see your friend buy an expensive phone and crib about it being laggy or slow. So what can be the alternative to all these "laggy phones"?
  • There may be time when you see your friend crib about latest android version not provided by their OEM. So what can you do in that scenario?
  • There may be time when your friend buys a phone which is available just in your country. It does not sell globally. And his phone develops some problem, And he comes to you to solve his problem. You try searching for the solution to that problem on Google. But his phone being a local one, not much support is available from  developers. Hence no relevant solution is available to you (Just limited solution by your local developers can be found). So what will you do in that scenario? [I am not at all saying that local community is not much helpful or active, just giving readers an idea of what they would be missing].
So what can you do, if you are stuck in above scenario? Not much. Because your friend has already done a mistake on his part to not buy a nexus device. But you can help your self by not doing that mistake.

So I would be writing in this post about why you should buy a nexus device. You would be thinking from where has this sudden love for android has awaken. But let me tell you it was already there. Before it was just limited to me, as I didn't wanted to force my love on everyone. But I have seen many people who don't know about nexus devices, their plus points, why they should prefer nexus devices above local manufacturers. Yes! believe me such people still exist. All they know is nexus devices are made by Asus/Lg, and the companies making them are not so famous or have bad customer support. But let me tell you that, along with Asus/Lg, nexus devices also have major connection with Google. By major I mean they provide the software for these phones. And till your bad customer support is concerned, I think these are global companies, so they ought to have nice support. Atleast better than what your local device maker is providing. Sometime slip ups occur from their part too. But that can be tolerated till you want an "proper" Android phone.






So, why should you buy an android phone?

  • Want to get Android updates quickly - Google providing software for your phone means they will keep you updated with whatever they release. So if you want to get android update quickly than you should not think beyond nexus devices. If you want a phone 
  •  Want to feel real Android - By real, I mean unadulterated form of android. Currently all OEM's are adulterating android by adding software from their part. Samsung adulterates android with their laggy TouchWiz, HTC does same by adding HTC sense. So you buy an nexus device, all you get with it is android. Nothing else. You are just provided with pure/Vanilla form of android.
  • Want a Cheap, yet quality phone -  Nexus devices are cheap as compared to other phones that provide similar hardware. All nexus devices are not so cheap (in all countries) but are quality products. And increased prices in some countries can be attributed to many reasons including tax, importing cost etc.
  •  Want to get Developer Support - Nexus devices are known for being developer friendly. And being a Google product, there is ought to be a global presence. And this results in plethora of developers striving hard to get you something different and better than what other devices are offering.
You have any other points to  include here or don't agree with any of my points here than do comment below. It will just make us both more wise.