Posts

Calling private method of other class which is not accessible.

Hey Guys, Here you will get to know you can access private method using invoke method. Generally Private methods can usually only be accessed from within the same class. We can’t access those private methods from outside class. However, It’s possible to access the private methods from outside class using Java's Reflection API . I have written this code in Android. Here is the code: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout. activity_main ); Fruit d = new Fruit(); Method m = null ; try { m = Fruit. class .getDeclaredMethod( " fruitname" ); m.setAccessible( true );   m.invoke(d);   } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); }

post1

Using RecyclerView : Dependency :  compile 'com.android.support:recyclerview-v7:27.0.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' compile 'com.jakewharton:butterknife:8.8.1' <? xml version= "1.0" encoding= "utf-8" ?> < android.support.constraint.ConstraintLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: app = "http://schemas.android.com/apk/res-auto" xmlns: tools = "http://schemas.android.com/tools" android :layout_width= "match_parent" android :layout_height= "match_parent" tools :context= "com.app.mgu.recyclerview.MainActivity" > < android.support.v7.widget.RecyclerView android :id= "@+id/recyclerView" android :layout_width= "match_parent" android :layout_height= "match_parent" android :text= "Hello World!"

allphp

1. job.php ------------------------------------------------------------------------------------------------- <?php $dbname = "2216189_db"; $user = "2216189_db"; $pass = "password1@"; $servername = "fdb14.awardspace.net"; // Create connection         $con =  mysqli_connect($servername,$user,$pass,$dbname); $filter_field = isset($_GET['filter']) ? $_GET['filter'] : 10; //10 is the default $sql = "SELECT * FROM job ORDER BY ".$filter_field; $sql = "SELECT * FROM job ORDER BY salary"; $result  = array(); $ro = $con->query($sql); if ($ro->num_rows > 0) { while($row = $ro->fetch_assoc()) { $date = new DateTime($row["last_date"]); $res_date = $date->format('Y-m-d H:i:s'); $res[] = array("job_id" => $row["job_id"],"job_name" => $row["job_name"],"place" => $ro

Using OKHttp3

// It is used to get JsonData from URL new AsyncTask<Void, Void,String>() { @Override protected String doInBackground(Void... voids) { OkHttpClient okHttp = new OkHttpClient(); Request request = new Request.Builder().url( "https://api.github.com/users/ashokslsk" ).build(); try { Response response = okHttp.newCall(request).execute(); System. out .println( "ResponseRupal:::::" + response.body().string()); return "Hi" ; } catch (IOException e) { e.printStackTrace(); } return null ; } }.execute();

How to Use Co-routine For Taking Touch Event in Unity(Mouse Event And Keyboard KeyEvent), Also Explained How to call coroutine from other script

1. Co-routine for Taking Touch Event Step 1: Add Box-Collider to Your GameObject On which you want take touch event. Write Following in followpath.CS Step 2 : Following is Co-Routine for taking touch event.              ------------------------------------------------------------------------------ // This method accepts gameobject  name parameter,  // Then in this method we get name of object on which user tap. // If both equals then we end while loop.In this way we can take touch event and mouse click event. public IEnumerator WaitForTouch_Player(string player1)  {   bool found = false;   Touch touch;   Ray screenRay;   RaycastHit hit;   string objname;   while (Input.touchCount == 0 || found == false)   {    if (Input.touchCount > 0) {     touch = Input.GetTouch (0);     if (touch.phase == TouchPhase.Began) {      screenRay = Camera.main.ScreenPointToRay (touch.position);      if (Physics.Raycast (screenRay, out hit)) {       objname = hi