Tuesday, July 17, 2018

Eight smartphone-controlled Gadgets

Life at your fingertips: Eight smartphone-controlled gadgets

Griffin Helo TC

Griffin-Helo-TC
This $50 helicopter uses metal parts and flexible blades, and hovers in place with better precision than most RC copters. Using your iPhone (you can also use an iPod Touch or an iPad), you can control the Helo either using motions (up, down, side to side to steer) or a virtual touchscreen joystick. Your phone snaps into a docking station and connects using a 3.5mm headphone jack. The dock then sends commands using infrared. The free Helo app can use one of three channels – which means two friends can control their own copters in the same room. It also comes with replacement parts, since real-life helicopter crashes involve more than hitting “restart.”

Sonos Play:3

Sonos-Pla-3Sonos has carved out quite a niche for streaming music all around your home. Each player can be connected together over a Wi-Fi network. Now, the Play:3 model, for $299, is one of the lowest-cost options, and it’s totally self-contained. The built-in speaker uses three drivers for more realistic sound. Best yet: you can control the device with your iPhone instead of using the extra Sonos controller. You can stream music form your computer or from a service like Spotify Premium directly.

Desk Pets TankBot

Desk-Pets-TankBotAvailable this month for under $25, the TankBot is one of the most unique (and low-cost) gadgets you can control with an iPhone. (It also works with Android phones and the iPad.) You charge the tiny tracked crawler via a flip-down USB port, then control it with the iDeskPet remote app. You can also press a button to put the TankBot into a free-roaming mode, where it uses infrared to sense obstructions, making crazy bleeps and sound effects along the way.

iZON

izonFor $130, the iZON Remote Room Monitor is a brilliant way to get more out of your iPhone or iPad by using it to monitor your home from anywhere. The device connects to your local Wi-Fi network – setup is a bit of a chore, because you have to first connect to a private iZON network and then configure security settings for your own network. Once connected, the device streams audio and video to your phone over the Internet. For monitoring a sleeping baby in the other room, or checking on your living room during the day, the iZON is a smart idea. You can view video feeds for five minutes. When the device senses audio over a specific level, it can record a clip and send the video directly to YouTube, or you can get an alert by email.

Sphero

SpheroWe first saw these crazy spherical bots at a CES demo; There’s a multi-colored ball, a charging station (you just set the ball in the cradle to charge) and a bunch of apps you can use for a virtual playground. You control the ball by either moving your iPhone or Android phone, tapping on the screen, or using touch sliders. A boost mode propels the ball over an object or to zip around a little faster. The device connects over Bluetooth, and will start shipping this fall for $130.

Flash2Pass

Flash2Pass
One of the most unique gadgets we found that can be controlled by an iPhone, this garage-door opener normally works with a receiver in your car – you just flash your high-beams to open the garage door. The $80 kit is easy to install, and means no lost garage-door openers. This fall, Flash2Pass will release a free app for the iPhone where you can also tap in a passcode to open your garage door. That means you don’t need to have your car around, since the app connects over Bluetooth.

Cyber-Rain XCI

Cyber-Rain-XCIThis $500 kit includes a module that you use with your existing in-ground sprinkler system. Once connected, you can use your iPhone to trigger sprinklers. Or, you can set an irrigation schedule using the app. The system can be set to respond to weather conditions – shutting down when it rains, or irrigating more on hot sunny days. There are versions for 8- or 16-zone sprinkler systems.

BeeWi Mini Cooper S

BeeWi-Mini-Cooper-SAvailable at the MobileFun site in the UK for import into the US, the BeeWi is a radio-controlled car that you control with your Android phone. We tested one with the new Samsung Galaxy S II – the phone you use is important because the free app responds faster to motions with a more powerful phone. You can go forward and turn, or set the parking brake. The car zips along incredibly fast. You can also use an older Nokia S60 phone – and there’s an option to use touchscreen controls, rather than tilting.

Life at your fingertips: Eight smartphone-controlled gadgets

Griffin Helo TC

Griffin-Helo-TC
This $50 helicopter uses metal parts and flexible blades, and hovers in place with better precision than most RC copters. Using your iPhone (you can also use an iPod Touch or an iPad), you can control the Helo either using motions (up, down, side to side to steer) or a virtual touchscreen joystick. Your phone snaps into a docking station and connects using a 3.5mm headphone jack. The dock then sends commands using infrared. The free Helo app can use one of three channels – which means two friends can control their own copters in the same room. It also comes with replacement parts, since real-life helicopter crashes involve more than hitting “restart.”

Sonos Play:3

Sonos-Pla-3Sonos has carved out quite a niche for streaming music all around your home. Each player can be connected together over a Wi-Fi network. Now, the Play:3 model, for $299, is one of the lowest-cost options, and it’s totally self-contained. The built-in speaker uses three drivers for more realistic sound. Best yet: you can control the device with your iPhone instead of using the extra Sonos controller. You can stream music form your computer or from a service like Spotify Premium directly.

Desk Pets TankBot

Desk-Pets-TankBotAvailable this month for under $25, the TankBot is one of the most unique (and low-cost) gadgets you can control with an iPhone. (It also works with Android phones and the iPad.) You charge the tiny tracked crawler via a flip-down USB port, then control it with the iDeskPet remote app. You can also press a button to put the TankBot into a free-roaming mode, where it uses infrared to sense obstructions, making crazy bleeps and sound effects along the way.

iZON

izonFor $130, the iZON Remote Room Monitor is a brilliant way to get more out of your iPhone or iPad by using it to monitor your home from anywhere. The device connects to your local Wi-Fi network – setup is a bit of a chore, because you have to first connect to a private iZON network and then configure security settings for your own network. Once connected, the device streams audio and video to your phone over the Internet. For monitoring a sleeping baby in the other room, or checking on your living room during the day, the iZON is a smart idea. You can view video feeds for five minutes. When the device senses audio over a specific level, it can record a clip and send the video directly to YouTube, or you can get an alert by email.

Sphero

SpheroWe first saw these crazy spherical bots at a CES demo; There’s a multi-colored ball, a charging station (you just set the ball in the cradle to charge) and a bunch of apps you can use for a virtual playground. You control the ball by either moving your iPhone or Android phone, tapping on the screen, or using touch sliders. A boost mode propels the ball over an object or to zip around a little faster. The device connects over Bluetooth, and will start shipping this fall for $130.

Flash2Pass

Flash2Pass
One of the most unique gadgets we found that can be controlled by an iPhone, this garage-door opener normally works with a receiver in your car – you just flash your high-beams to open the garage door. The $80 kit is easy to install, and means no lost garage-door openers. This fall, Flash2Pass will release a free app for the iPhone where you can also tap in a passcode to open your garage door. That means you don’t need to have your car around, since the app connects over Bluetooth.

Cyber-Rain XCI

Cyber-Rain-XCIThis $500 kit includes a module that you use with your existing in-ground sprinkler system. Once connected, you can use your iPhone to trigger sprinklers. Or, you can set an irrigation schedule using the app. The system can be set to respond to weather conditions – shutting down when it rains, or irrigating more on hot sunny days. There are versions for 8- or 16-zone sprinkler systems.

BeeWi Mini Cooper S

BeeWi-Mini-Cooper-SAvailable at the MobileFun site in the UK for import into the US, the BeeWi is a radio-controlled car that you control with your Android phone. We tested one with the new Samsung Galaxy S II – the phone you use is important because the free app responds faster to motions with a more powerful phone. You can go forward and turn, or set the parking brake. The car zips along incredibly fast. You can also use an older Nokia S60 phone – and there’s an option to use touchscreen controls, rather than tilting.

Wednesday, July 11, 2018

Google Search bar (widget) Samsung Galaxy device

How do I add the Google Search bar (widget) to my Samsung Galaxy device?


1. When on the Home screen tap and hold on an available space.

how_to_get_okgoogle_on_home_screen_1

2. Tap Widgets.

how_to_get_okgoogle_on_home_screen_2

3. Navigate through your Widgets and select Google Search.
 
Note: you need to have Google Apps enabled in order for the Google Search bar to be available in your widgets. If you cannot find the search bar, enable Google Apps and check again. You can find out how to enable Google apps here.

how_to_get_okgoogle_on_home_screen_3

4. Tap and hold Google Search.

how_to_get_okgoogle_on_home_screen_4

5. Drag and drop the widget onto the available space.

how_to_get_okgoogle_on_home_screen_5
6. Google Search will now appear on your Home Screen.

how_to_get_okgoogle_on_home_screen_6

How do I add the Google Search bar (widget) to my Samsung Galaxy device?


1. When on the Home screen tap and hold on an available space.

how_to_get_okgoogle_on_home_screen_1

2. Tap Widgets.

how_to_get_okgoogle_on_home_screen_2

3. Navigate through your Widgets and select Google Search.
 
Note: you need to have Google Apps enabled in order for the Google Search bar to be available in your widgets. If you cannot find the search bar, enable Google Apps and check again. You can find out how to enable Google apps here.

how_to_get_okgoogle_on_home_screen_3

4. Tap and hold Google Search.

how_to_get_okgoogle_on_home_screen_4

5. Drag and drop the widget onto the available space.

how_to_get_okgoogle_on_home_screen_5
6. Google Search will now appear on your Home Screen.

how_to_get_okgoogle_on_home_screen_6

Install Google Toolbar

Install Google Toolbar


Install Google Toolbar - Topandroidgadgets.blogspot.com

You can install Google Toolbar on Internet Explorer to search Google from any webpage, fill out web forms, translate webpages, and more.
To use Google Toolbar, you need a device with Windows XP, Vista, or 7+ and Internet Explorer 6 or up.
  1. Uninstall any older versions of Google Toolbar.
  2. Go to the Google Toolbar download page.
  3. Click Download Google Toolbar.
  4. Read the Terms of Service and click Accept and Install.
  5. If necessary, click to approve Google Toolbar to run on your computer.
  6. After you're finished installing, click Enable.

Problems installing Google Toolbar

If you installed Toolbar but don't see it, try these steps.

Uninstall Toolbar

  1. Open Internet Explorer.
  2. Next to Options Options , click the Down Arrow Down Arrow and then Uninstall.
  3. Click Ok.

Install Google Toolbar


Install Google Toolbar - Topandroidgadgets.blogspot.com

You can install Google Toolbar on Internet Explorer to search Google from any webpage, fill out web forms, translate webpages, and more.
To use Google Toolbar, you need a device with Windows XP, Vista, or 7+ and Internet Explorer 6 or up.
  1. Uninstall any older versions of Google Toolbar.
  2. Go to the Google Toolbar download page.
  3. Click Download Google Toolbar.
  4. Read the Terms of Service and click Accept and Install.
  5. If necessary, click to approve Google Toolbar to run on your computer.
  6. After you're finished installing, click Enable.

Problems installing Google Toolbar

If you installed Toolbar but don't see it, try these steps.

Uninstall Toolbar

  1. Open Internet Explorer.
  2. Next to Options Options , click the Down Arrow Down Arrow and then Uninstall.
  3. Click Ok.

Transparent Google Search Widget Android

Google app for Android adds a small transparent widget under the search bar

Google is currently in the process of adding a new feature to its eponymous app for Android Gadgets. Simply put, it's a new widget that shows up under the big white persistent search bar in your launcher. The widget is transparent and can show you small tidbits of information, such as the weather at your location, commute time, or local information.

Transparent Google Search Widget Android - Topandroidgadgets.blogspot.com

Above is the way it looks. The screenshots below will help guide you in order to enable it. Go to the Google app's settings and then choose Widget, and turn it on. Note that as with all things Google-related, this one's part of a staged rollout too, so you may not even see the Widget option yet.

Google app for Android adds a small transparent widget under the search bar - Topandroidgadgets.blogspot.com


Oh, and even if you do, and you enable it, the widget itself might now show up immediately - or at all. The functionality probably requires a server-side switch too, and Google seems to be taking its time in doing that for all users. One thing to note is that you are apparently required to have the Google app version 6.6.14.21 or later in order for this to work - and to get that you may have to register as a beta tester for the app (you can do that from its Play Store listing, but the usual warnings about running beta software on your daily driver apply).

One final note: the new widget might not be shown at all times, even after everything is enabled for you (including that server-side switch). Hopefully this will change in the future, and it will gain support for more Google Now cards.

Google app for Android adds a small transparent widget under the search bar

Google is currently in the process of adding a new feature to its eponymous app for Android Gadgets. Simply put, it's a new widget that shows up under the big white persistent search bar in your launcher. The widget is transparent and can show you small tidbits of information, such as the weather at your location, commute time, or local information.

Transparent Google Search Widget Android - Topandroidgadgets.blogspot.com

Above is the way it looks. The screenshots below will help guide you in order to enable it. Go to the Google app's settings and then choose Widget, and turn it on. Note that as with all things Google-related, this one's part of a staged rollout too, so you may not even see the Widget option yet.

Google app for Android adds a small transparent widget under the search bar - Topandroidgadgets.blogspot.com


Oh, and even if you do, and you enable it, the widget itself might now show up immediately - or at all. The functionality probably requires a server-side switch too, and Google seems to be taking its time in doing that for all users. One thing to note is that you are apparently required to have the Google app version 6.6.14.21 or later in order for this to work - and to get that you may have to register as a beta tester for the app (you can do that from its Play Store listing, but the usual warnings about running beta software on your daily driver apply).

One final note: the new widget might not be shown at all times, even after everything is enabled for you (including that server-side switch). Hopefully this will change in the future, and it will gain support for more Google Now cards.

Friday, July 6, 2018

Android Widgets Tutorials

A widget is a small gadget or control of your android application placed on the home screen. Android Widgets Tutorials can be very handy as they allow you to put your favourite applications on your home screen in order to quickly access them. You have probably seen some common widgets, such as music widget, weather widget, clock widget e.t.c
Android Widgets Tutorials could be of many types such as information widgets, collection widgets, control widgets and hybrid widgets. Android provides us a complete framework to develop our own widgets.

Widget - XML file

In order to create an application widget, first thing you need is Android Widgets Tutorials object, which you will define in a separate widget XML file. In order to do that, right click on your project and create a new folder called xml. Now right click on the newly created folder and create a new XML file. The resource type of the XML file should be set to Android Widgets Tutorials. In the xml file, define some properties which are as follows −
<appwidget-provider 
   xmlns:android="http://schemas.android.com/apk/res/android" 
   android:minWidth="146dp" 
   android:updatePeriodMillis="0" 
   android:minHeight="146dp" 
   android:initialLayout="@layout/activity_main">
</appwidget-provider>

Widget - Layout file

Now you have to define the layout of your widget in your default XML file. You can drag components to generate auto xml.

Widget - Java file

After defining layout, now create a new JAVA file or use existing one, and extend it with Android Widgets Tutorials class and override its update method as follows.
In the update method, you have to define the object of two classes which are PendingIntent and RemoteViews. Its syntax is −
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.activity_main);
In the end you have to call an update method update Android Widgets Tutorials() of the Android Widgets Tutorials class. Its syntax is −
appWidgetManager.updateAppWidget(currentWidgetId,views);  
A part from the updateAppWidget method, there are other methods defined in this class to manipulate widgets. They are as follows −
Sr.NoMethod & Description
1
onDeleted(Context context, int[] appWidgetIds)
This is called when an instance of AppWidgetProvider is deleted.
2
onDisabled(Context context)
This is called when the last instance of AppWidgetProvider is deleted
3
onEnabled(Context context)
This is called when an instance of AppWidgetProvider is created.
4
onReceive(Context context, Intent intent)
It is used to dispatch calls to the various methods of the class

Widget - Manifest file

You also have to declare the Android Widgets Tutorials class in your manifest file as follows:
<receiver android:name="ExampleAppWidgetProvider" >
   
   <intent-filter>
      <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
   </intent-filter>
   
   <meta-data android:name="android.appwidget.provider"
      android:resource="@xml/example_appwidget_info" />
</receiver>

Example

Here is an example demonstrating the use of application Widget. It creates a basic widget applications that will open this current website in the browser.
To experiment with this example, you need to run this on an actual device on which internet is running.
StepsDescription
1You will use Android studio to create an Android application under a package com.example.sairamkrishna.myapplication.
2Modify src/MainActivity.java file to add widget code.
3Modify the res/layout/activity_main to add respective XML components
4Create a new folder and xml file under res/xml/mywidget.xml to add respective XML components
5Modify the AndroidManifest.xml to add the necessary permissions
6Run the application and choose a running android device and install the application on it and verify the results.
Following is the content of the modified MainActivity.java.
package com.example.sairamkrishna.myapplication;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.RemoteViews;
import android.widget.Toast;

public class MainActivity extends AppWidgetProvider{
   public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {
      for(int i=0; i<appWidgetIds.length; i++){
         int currentWidgetId = appWidgetIds[i];
         String url = "http://www.tutorialspoint.com";
         
         Intent intent = new Intent(Intent.ACTION_VIEW);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         intent.setData(Uri.parse(url));
         
         PendingIntent pending = PendingIntent.getActivity(context, 0,intent, 0);
         RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.activity_main);
         
         views.setOnClickPendingIntent(R.id.button, pending);
         appWidgetManager.updateAppWidget(currentWidgetId,views);
         Toast.makeText(context, "widget added", Toast.LENGTH_SHORT).show();
      }
   }
}
Following is the modified content of the xml res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
   android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"
   android:paddingBottom="@dimen/activity_vertical_margin"
   tools:context=".MainActivity"
   android:transitionGroup="true">
   
   <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Tutorials point"
      android:id="@+id/textView"
      android:layout_centerHorizontal="true"
      android:textColor="#ff3412ff"
      android:textSize="35dp" />
      
   <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Widget"
      android:id="@+id/button"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="61dp"
      android:layout_below="@+id/textView" />

</RelativeLayout>
Following is the content of the res/xml/mywidget.xml.
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider 
   xmlns:android="http://schemas.android.com/apk/res/android" 
   android:minWidth="146dp" 
   android:updatePeriodMillis="0" 
   android:minHeight="146dp" 
   android:initialLayout="@layout/activity_main">
</appwidget-provider>
Following is the content of the res/values/string.xml.
<resources>
   <string name="app_name">My Application</string>
</resources>
Following is the content of AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example.sairamkrishna.myapplication" >
   
   <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" >
      <receiver android:name=".MainActivity">
      
      <intent-filter>
         <action android:name="android.appwidget.action.APPWIDGET_UPDATE"></action>
      </intent-filter>
      
      <meta-data android:name="android.appwidget.provider"
         android:resource="@xml/mywidget"></meta-data>
      
      </receiver>
   
   </application>
</manifest>
Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Android studio, open one of your project's activity files and click Run Eclipse Run Icon icon from the tool bar. Before starting your application, Android studio will display following window to select an option where you want to run your Android application.
Anroid Widget Tutorial
Select your mobile device as an option and then check your mobile device which will display your default screen −
Anroid Widget Tutorial
Go to your widget section and add your created widget to the desktop or home screen. It would look something like this −
Anroid Widget Tutorial
Now just tap on the widget button that appears, to launch the browser. But before that please make sure that you are connected to the internet. After pressing the button , the following screen would appear −
Anroid Widget Tutorial
Note. By just changing the url in the java file, your widget will open your desired website in the browser.

A widget is a small gadget or control of your android application placed on the home screen. Android Widgets Tutorials can be very handy as they allow you to put your favourite applications on your home screen in order to quickly access them. You have probably seen some common widgets, such as music widget, weather widget, clock widget e.t.c
Android Widgets Tutorials could be of many types such as information widgets, collection widgets, control widgets and hybrid widgets. Android provides us a complete framework to develop our own widgets.

Widget - XML file

In order to create an application widget, first thing you need is Android Widgets Tutorials object, which you will define in a separate widget XML file. In order to do that, right click on your project and create a new folder called xml. Now right click on the newly created folder and create a new XML file. The resource type of the XML file should be set to Android Widgets Tutorials. In the xml file, define some properties which are as follows −
<appwidget-provider 
   xmlns:android="http://schemas.android.com/apk/res/android" 
   android:minWidth="146dp" 
   android:updatePeriodMillis="0" 
   android:minHeight="146dp" 
   android:initialLayout="@layout/activity_main">
</appwidget-provider>

Widget - Layout file

Now you have to define the layout of your widget in your default XML file. You can drag components to generate auto xml.

Widget - Java file

After defining layout, now create a new JAVA file or use existing one, and extend it with Android Widgets Tutorials class and override its update method as follows.
In the update method, you have to define the object of two classes which are PendingIntent and RemoteViews. Its syntax is −
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.activity_main);
In the end you have to call an update method update Android Widgets Tutorials() of the Android Widgets Tutorials class. Its syntax is −
appWidgetManager.updateAppWidget(currentWidgetId,views);  
A part from the updateAppWidget method, there are other methods defined in this class to manipulate widgets. They are as follows −
Sr.NoMethod & Description
1
onDeleted(Context context, int[] appWidgetIds)
This is called when an instance of AppWidgetProvider is deleted.
2
onDisabled(Context context)
This is called when the last instance of AppWidgetProvider is deleted
3
onEnabled(Context context)
This is called when an instance of AppWidgetProvider is created.
4
onReceive(Context context, Intent intent)
It is used to dispatch calls to the various methods of the class

Widget - Manifest file

You also have to declare the Android Widgets Tutorials class in your manifest file as follows:
<receiver android:name="ExampleAppWidgetProvider" >
   
   <intent-filter>
      <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
   </intent-filter>
   
   <meta-data android:name="android.appwidget.provider"
      android:resource="@xml/example_appwidget_info" />
</receiver>

Example

Here is an example demonstrating the use of application Widget. It creates a basic widget applications that will open this current website in the browser.
To experiment with this example, you need to run this on an actual device on which internet is running.
StepsDescription
1You will use Android studio to create an Android application under a package com.example.sairamkrishna.myapplication.
2Modify src/MainActivity.java file to add widget code.
3Modify the res/layout/activity_main to add respective XML components
4Create a new folder and xml file under res/xml/mywidget.xml to add respective XML components
5Modify the AndroidManifest.xml to add the necessary permissions
6Run the application and choose a running android device and install the application on it and verify the results.
Following is the content of the modified MainActivity.java.
package com.example.sairamkrishna.myapplication;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.RemoteViews;
import android.widget.Toast;

public class MainActivity extends AppWidgetProvider{
   public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {
      for(int i=0; i<appWidgetIds.length; i++){
         int currentWidgetId = appWidgetIds[i];
         String url = "http://www.tutorialspoint.com";
         
         Intent intent = new Intent(Intent.ACTION_VIEW);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         intent.setData(Uri.parse(url));
         
         PendingIntent pending = PendingIntent.getActivity(context, 0,intent, 0);
         RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.activity_main);
         
         views.setOnClickPendingIntent(R.id.button, pending);
         appWidgetManager.updateAppWidget(currentWidgetId,views);
         Toast.makeText(context, "widget added", Toast.LENGTH_SHORT).show();
      }
   }
}
Following is the modified content of the xml res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
   android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"
   android:paddingBottom="@dimen/activity_vertical_margin"
   tools:context=".MainActivity"
   android:transitionGroup="true">
   
   <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Tutorials point"
      android:id="@+id/textView"
      android:layout_centerHorizontal="true"
      android:textColor="#ff3412ff"
      android:textSize="35dp" />
      
   <Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Widget"
      android:id="@+id/button"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="61dp"
      android:layout_below="@+id/textView" />

</RelativeLayout>
Following is the content of the res/xml/mywidget.xml.
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider 
   xmlns:android="http://schemas.android.com/apk/res/android" 
   android:minWidth="146dp" 
   android:updatePeriodMillis="0" 
   android:minHeight="146dp" 
   android:initialLayout="@layout/activity_main">
</appwidget-provider>
Following is the content of the res/values/string.xml.
<resources>
   <string name="app_name">My Application</string>
</resources>
Following is the content of AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example.sairamkrishna.myapplication" >
   
   <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" >
      <receiver android:name=".MainActivity">
      
      <intent-filter>
         <action android:name="android.appwidget.action.APPWIDGET_UPDATE"></action>
      </intent-filter>
      
      <meta-data android:name="android.appwidget.provider"
         android:resource="@xml/mywidget"></meta-data>
      
      </receiver>
   
   </application>
</manifest>
Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Android studio, open one of your project's activity files and click Run Eclipse Run Icon icon from the tool bar. Before starting your application, Android studio will display following window to select an option where you want to run your Android application.
Anroid Widget Tutorial
Select your mobile device as an option and then check your mobile device which will display your default screen −
Anroid Widget Tutorial
Go to your widget section and add your created widget to the desktop or home screen. It would look something like this −
Anroid Widget Tutorial
Now just tap on the widget button that appears, to launch the browser. But before that please make sure that you are connected to the internet. After pressing the button , the following screen would appear −
Anroid Widget Tutorial
Note. By just changing the url in the java file, your widget will open your desired website in the browser.