Skip to main content

Featured

Android studio “SDK tools directory is missing”

Following 2 possible solutions will resolve this problem :  Solution1 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:" Delete your  ~/.Android*  folders (losing all of your settings :/). Run Android Studio. It will show you a welcome wizard where it tries to download the SDK again (and fails due to my rubbish internet). Click the X on the wizard window. That will enable you to get to the normal welcome dialog. Go to Settings->Project Defaults->Project Structure and change the Android SDK location to the correct one. Solution 2 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:&quo

code to add rounded border to QRImage ,through xml file(below code used in my JOR-Project),in Android

Here iam generating and displaying QR-image ,and that image will added to Bitmap and that bitmap will be added to ImageView,in my JOR-Project.. 


TrafficcaseDetailsScreen.java:
 b = Bitmap.createBitmap( 300, 320, Bitmap.Config.ARGB_8888);              
                Canvas c = new Canvas(b);
                //v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height);
                view.draw(c); 
              
          
            //traffic_case_qr_image.addView(view,p);
          
            ImageView qrPri=(ImageView)findViewById(R.id.qrImagePre);
            if(null!=qrPri){
            qrPri.setImageBitmap(b);
            }
        }


trafficcasedetails_screen.xml:
  <LinearLayout
                    android:layout_width="180dip"
                    android:layout_height="220dip"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:layout_marginLeft="25dip"
                    android:layout_marginTop="25dip"
                    android:background="@drawable/rounded_border" >

                    <ImageView
                        android:id="@+id/qrImagePre"
                        android:layout_width="200dip"
                        android:layout_height="250dip"
                        android:contentDescription="content description"
                        android:scaleType="fitXY"
                        android:visibility="visible" />
                </LinearLayout>

rounded_border.xml:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke android:width="2dp" android:color="#30000000" />
    <solid android:color="@color/White"/>
    <padding android:left="2dp" android:top="2dp"
            android:right="2dp" android:bottom="2dp" />
      <gradient
    android:startColor="@color/White"
    android:endColor="@color/White"
    android:angle="270"/>     
    <corners android:radius="8dp" />
</shape>


Comments