Wednesday, March 28, 2018

Select long text in spinner then create space

Leave a Comment

when i select long text in my spinner then its create space between textView and spinner

see my default spinner :

enter image description here

after selecting a long text it's look like below shot:

enter image description here

below is xml code :

<TextView                     style="@style/TextLabelBookGray"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_gravity="center_vertical"                     android:layout_weight="1"                     android:text="@string/hint_state"                     android:textSize="@dimen/_14ssp"                     android:paddingLeft="@dimen/_2sdp"                     android:visibility="visible" />                  <android.support.v7.widget.AppCompatSpinner                     android:id="@+id/spStates"                     style="@style/TextLabelBookBlack"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_gravity="center_vertical"                     android:layout_marginBottom="@dimen/_4sdp"                     android:layout_marginTop="@dimen/_4sdp"                     android:layout_weight="1"                     android:entries="@array/us_states"                     /> 

below code is style.xml:

<style name="TextLabelBookGray" parent="FontBook">         <item name="android:textSize">@dimen/_14ssp</item>         <item name="android:textColor">@color/input_color_gray</item> 

any one have any idea how to i fix it

Thanks in advance :

4 Answers

Answers 1

You set spinner height as "wrap_content" so it will automatically adjust its height.You should set Spinner row's Textview max line as 1.Then it will not show double line. Textview xml file

android:maxLines="1" 

Answers 2

Adding to @Kush answer, Please make sure that your parent also having wrap_content so that your spinner text can show in one line. Otherwise, It will look same even if you give wrap_content to your spinner.

Please use below code:

  <android.support.v7.widget.AppCompatSpinner                             android:id="@+id/spStates"                             style="@style/TextLabelBookBlack"                             android:layout_width="match_parent"                             android:layout_height="wrap_content"                             android:layout_gravity="center_vertical"                             android:layout_marginBottom="@dimen/_4sdp"                             android:layout_marginTop="@dimen/_4sdp"                             android:layout_weight="1"                             android:maxLines="1"                             android:entries="@array/us_states"                             /> 

Answers 3

The thing is that your textView and spinner shares 50% and 50% of parent view. Better you set weightSum to parent view and allocate more width to spinner. Then you can have one line text in spinner.

<LinearLayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:weightSum="10">              <TextView                 style="@style/TextLabelBookGray"                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_gravity="center_vertical"                 android:layout_weight="2.5"                 android:text="@string/hint_state"                 android:textSize="@dimen/_14ssp"                 android:paddingLeft="@dimen/_2sdp"                 android:visibility="visible" />              <android.support.v7.widget.AppCompatSpinner                 android:id="@+id/spStates"                 style="@style/TextLabelBookBlack"                 android:layout_width="0dp"                 android:layout_height="wrap_content"                 android:layout_gravity="center_vertical"                 android:layout_marginBottom="@dimen/_4sdp"                 android:layout_marginTop="@dimen/_4sdp"                 android:layout_weight="7.5"                 android:entries="@array/us_states"/>          </LinearLayout> 

This is a working example and adjust the weight according to your need.

Answers 4

If you can set your spinner width in fixed side and weight of spinner remove then your problem will solve automatically..buddy..!

            <TextView                     style="@style/TextLabelBookGray"                     android:layout_width="match_parent"                     android:layout_height="wrap_content"                     android:layout_gravity="center_vertical"                     android:layout_weight="1"                     android:text="@string/hint_state"                     android:textSize="@dimen/_14ssp"                     android:paddingLeft="@dimen/_2sdp"                     android:visibility="visible" />                  <android.support.v7.widget.AppCompatSpinner                     android:id="@+id/spStates"                     style="@style/TextLabelBookBlack"                     android:layout_width="150dp"                     android:layout_height="wrap_content"                     android:layout_gravity="center_vertical"                     android:layout_marginBottom="@dimen/_4sdp"                     android:layout_marginTop="@dimen/_4sdp"                     android:entries="@array/us_states"                     /> 

i hope it can help you..!

Read More

How can I change the color of a Selector Rendere in iOS to be a new color?

Leave a Comment

I am using code that creates a selector looking like this:

<local:CustomSwitch

What I would like to do is to change the code so that what is blue all changed to a color specified in the XAML. Does anyone have any ideas as to how this could be done?

The XAML I use looks like this:

<local:SegmentedControl ValueChanged="OnModeChanged" x:Name="segControlMode" HorizontalOptions="End">    <local:SegmentedControl.Children>       <local:SegmentedControlOption Text="Learn" />       <local:SegmentedControlOption Text="Quiz" />    </local:SegmentedControl.Children> </local:SegmentedControl> 

iOS renderer:

using UIKit; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; using System.Diagnostics; using System;  [assembly: ExportRenderer(typeof(Japanese.SegmentedControl), typeof(Japanese.iOS.SegmentedControlRenderer))] namespace Japanese.iOS {     public class SegmentedControlRenderer : ViewRenderer<SegmentedControl, UISegmentedControl>     {         protected override void OnElementChanged(ElementChangedEventArgs<SegmentedControl> e)         {             base.OnElementChanged(e);              UISegmentedControl segmentedControl = null;             if (Control == null)             {                 segmentedControl = new UISegmentedControl();                  for (var i = 0; i < e.NewElement.Children.Count; i++)                 {                     segmentedControl.InsertSegment(Element.Children[i].Text, i, false);                 }                  SetNativeControl(segmentedControl);                 SetSelectedSegment();             }              if (e.OldElement != null)             {                 // Unsubscribe from event handlers and cleanup any resources                 if (segmentedControl != null)                     segmentedControl.ValueChanged -= NativeValueChanged;             }              if (e.NewElement != null)             {                 // Configure the control and subscribe to event handlers                 segmentedControl.ValueChanged += NativeValueChanged;             }         }          protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)         {             base.OnElementPropertyChanged(sender, e);              if (e.PropertyName == nameof(SegmentedControl.SelectedSegment))                 SetSelectedSegment();         }          void NativeValueChanged(object sender, EventArgs e)         {             if (Element is SegmentedControl formsElement)             {                 formsElement.SelectedSegment = (int)Control.SelectedSegment;             };         }          void SetSelectedSegment()         {             if (Element is SegmentedControl formsElement)             {                 if (formsElement.SelectedSegment >= 0 && formsElement.SelectedSegment < Control.NumberOfSegments)                     Control.SelectedSegment = formsElement.SelectedSegment;             }         }     } } 

What I would like to do is to change the color something like this in the XAML for example:

<local:SegmentedControl ValueChanged="OnModeChanged" x:Name="segControlMode" HorizontalOptions="End" Color="Red" >     <local:SegmentedControl.Children>       <local:SegmentedControlOption Text="Learn" />       <local:SegmentedControlOption Text="Quiz" />    </local:SegmentedControl.Children> </local:SegmentedControl> 

1 Answers

Answers 1

You can create a BindableProperty on the shared project class and handle its changes on the renderer.

Here are some changes you have to do:

Create one BindableProperty on the SegmentedControl class

public class SegmentedControl : Xamarin.Forms.View /* Replace this with your real inheritance */ {     /* ... The rest of your class ... */      public static readonly BindableProperty TintColorProperty = BindableProperty.Create(nameof(TintColor), typeof(Color), typeof(SegmentedControl), Color.Blue, BindingMode.OneWay);     public Color TintColor     {         get { return (Color)GetValue(TintColorProperty); }         set { SetValue(TintColorProperty, value); }     }      /* ... The rest of your class ... */ } 

Then transfer the selected color to the native control equivalent property on the Renderer's methods:

protected override void OnElementChanged(ElementChangedEventArgs<SegmentedControl> e) {     base.OnElementChanged(e);      /* ... Your previous code as it is now ...*/      segmentedControl.TintColor = e.NewElement?.TintColor.ToUIColor();      SetNativeControl(segmentedControl);     SetSelectedSegment();      /* ... Your further code as it is now ...*/ }  protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {     base.OnElementPropertyChanged(sender, e);      if (e.PropertyName == nameof(SegmentedControl.SelectedSegment))         SetSelectedSegment();      /* Keep one eye on changes after rendered */     if(e.PropertyName == SegmentedControl.TintColorProperty.PropertyName)         SetSegmentTintColor(); }  void SetSegmentTintColor() {     if (Element is SegmentedControl formsElement)         Control.TintColor = formsElement.TintColor; } 

I home it helps (and sorry any bad English spelling).

Read More

How Android Layout editor works?

Leave a Comment

before answering the question, keep in mind I have experience developing Android apps, I even know how to build an APK using Android SDK command line.

I want to build an utility that parses the layout file (.xml) and renders a preview. Summary: A layout previewer.

I've checked the source code of the isInEditMode() method, but it doesn't help, it only returns false

public boolean isInEditMode() {     return false; } 

I can't simply display images, because the Android Studio layout editor renders the preview according to:

  • The layout file
  • The styles file
  • The strings file (in case text uses a string resource)
  • The isInEditMode() method mentioned above
  • The .java file (for custom views)

The tools I'd need to use (e.g.: javac, aapt, aidl, dx, etc.) is not a problem for me.

At least I need to know where to start.

0 Answers

Read More

Animating In and Out with CSS

Leave a Comment

I have a menu which displays over the top of the current page once the hamburger icon is pressed which uses Glamor for CSS.

The menu animates in from the right of the screen and works perfectly, however i'm struggling to get it to animate out once anywhere in the Menu is pressed.

The animation is written (animateOut) but I need help with the code in flicking between animating in and out depending on the click:

  • Hamburger menu clicked -> menu slides in from the right.
  • Anywhere in the menu container is clicked -> menu slides out to the right.

HamburgerMenu.js

CSS

const cssHamburgerMenuIcon = css({     position: 'absolute',     height: 20,     width: 20,     right: 20,     marginTop: 20, })  const animateIn = css.keyframes({      '0%': {         transform: 'translateX(100%)'     },     '100%': {         transform: 'translateX(0%)'     } })  const animateOut = css.keyframes({      '0%': {         transform: 'translateX(0%)'     },     '100%': {         transform: 'translateX(100%)'     } })  const cssHamburgerMenu = css({     display: 'flex',     position: 'absolute',     flexDirection: 'column',     height: '100%',     width: 250,     right: 0,     top: 0,     zIndex: 1,     color: 'white',     backgroundColor: hamburgerGrey,     fontFamily: 'Century Gothic',     fontSize: '19px',     // animation     animation: `${animateIn} 0.5s`, })  const cssHamburgerList = css({     listStyleType: 'none',     lineHeight: '47px', })  const cssHamburgerListItem = css({  }) 

"CODE"

class HamburgerMenu extends Component {     constructor(props) {     super(props)     this.state = {         menuVisible: false,     } }      render() {         const menuVisible = this.state.menuVisible          return(             menuVisible ?             <div className={cssHamburgerMenu} onClick={() =>this.setState({ menuVisible: false })}>                               <ul className={cssHamburgerList}>                     <li className={cssHamburgerListItem}>Home</li>                     <li className={cssHamburgerListItem}>News</li>                     <li className={cssHamburgerListItem}>About us</li>                     <li className={cssHamburgerListItem}>More</li>                 </ul>             </div>             : (             <img                  className={cssHamburgerMenuIcon}                 src={HamburgerMenuIcon}                 onClick={() => this.setState({ menuVisible: true})                 }             />               )         )     } }     export default HamburgerMenu 

2 Answers

Answers 1

I suggest another approach:

  1. Set the menu's default translateX to 100%

  2. Create a class (i.e. open) which has translateX set to 0%

  3. Set the menu's transition property to "transition: all 0.5s ease-in-out;"

  4. Just add or remove the (open) class when needed to open/close the menu

Answers 2

i would suggest using bootstrap because its easier

Read More

Child control handling touch event affects multi-point manipulation

Leave a Comment

I have a UserControl that must respond to TouchUp events and this sits within a Viewbox which needs to be panned and scaled with pinch manipulation. Touch events on the control are handled fine. However pinch manipulations only scale the ViewPort if both pinch points are contained entirely within either the user control or the Viewport space around it. If the pinch straddles the user control boundary then the ManipulationDelta loses one of the points and reports a scale of (1,1).

If I remove IsManipulationEnabled="True" from the control handling the TouchUp event then the scaling works but the touch event doesn’t fire.

What can I do to retain the manipulation across the ViewPort whilst also handling the touch event in the user control?

Screen Grab

Test Solution

<Window x:Class="TouchTest.MainWindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         Title="Touch Test"          Height="400"          Width="700"         ManipulationDelta="OnManipulationDelta"         ManipulationStarting="OnManipulationStarting">      <Grid Background="Transparent"            IsManipulationEnabled="True">          <Viewbox x:Name="Viewbox"                  Stretch="Uniform">              <Viewbox.RenderTransform>                 <MatrixTransform/>             </Viewbox.RenderTransform>              <Grid Width="800"                    Height="800"                    Background="LightGreen"                   IsManipulationEnabled="True"                   TouchUp="OnTouchUp">                  <TextBlock x:Name="TimeTextBlock"                             FontSize="100"                            TextAlignment="Center"                            VerticalAlignment="Center"/>              </Grid>          </Viewbox>          <TextBlock x:Name="ScaleTextBlock"                     FontSize="10"                    HorizontalAlignment="Right"                    VerticalAlignment="Bottom"/>      </Grid> </Window> 

Handlers in code-behind:

private void OnTouchUp(object sender, TouchEventArgs e) {     TimeTextBlock.Text = DateTime.Now.ToString("H:mm:ss.fff"); }  private void OnManipulationStarting(object sender, ManipulationStartingEventArgs e) {     e.ManipulationContainer = this; }  private void OnManipulationDelta(object sender, ManipulationDeltaEventArgs e) {     if (Viewbox == null)     {         return;     }      ManipulationDelta delta = e.DeltaManipulation;      ScaleTextBlock.Text = $"Delta Scale: {delta.Scale}";      MatrixTransform transform = Viewbox.RenderTransform as MatrixTransform;      if (transform == null)     {         return;     }      Matrix matrix = transform.Matrix;      Point position = ((FrameworkElement)e.ManipulationContainer).TranslatePoint(e.ManipulationOrigin, Viewbox);      position = matrix.Transform(position);      matrix = MatrixTransformations.ScaleAtPoint(matrix, delta.Scale.X, delta.Scale.Y, position);     matrix = MatrixTransformations.PreventNegativeScaling(matrix);     matrix = MatrixTransformations.Translate(matrix, delta.Translation);     matrix = MatrixTransformations.ConstrainOffset(Viewbox.RenderSize, matrix);      transform.Matrix = matrix; } 

Supporting class:

public static class MatrixTransformations {     /// <summary>     /// Prevent the transformation from being offset beyond the given size rectangle.     /// </summary>     /// <param name="size"></param>     /// <param name="matrix"></param>     /// <returns></returns>     public static Matrix ConstrainOffset(Size size, Matrix matrix)     {         double distanceBetweenViewRightEdgeAndActualWindowRight = size.Width * matrix.M11 - size.Width + matrix.OffsetX;         double distanceBetweenViewBottomEdgeAndActualWindowBottom = size.Height * matrix.M22 - size.Height + matrix.OffsetY;          if (distanceBetweenViewRightEdgeAndActualWindowRight < 0)         {             // Moved in the x-axis too far left. Snap back to limit             matrix.OffsetX -= distanceBetweenViewRightEdgeAndActualWindowRight;         }          if (distanceBetweenViewBottomEdgeAndActualWindowBottom < 0)         {             // Moved in the x-axis too far left. Snap back to limit             matrix.OffsetY -= distanceBetweenViewBottomEdgeAndActualWindowBottom;         }          // Prevent positive offset         matrix.OffsetX = Math.Min(0.0, matrix.OffsetX);         matrix.OffsetY = Math.Min(0.0, matrix.OffsetY);          return matrix;     }      /// <summary>     /// Prevent the transformation from performing a negative scale.     /// </summary>     /// <param name="matrix"></param>     /// <returns></returns>     public static Matrix PreventNegativeScaling(Matrix matrix)     {         matrix.M11 = Math.Max(1.0, matrix.M11);         matrix.M22 = Math.Max(1.0, matrix.M22);          return matrix;     }      /// <summary>     /// Translate the matrix by the given vector to providing panning.     /// </summary>     /// <param name="matrix"></param>     /// <param name="vector"></param>     /// <returns></returns>     public static Matrix Translate(Matrix matrix, Vector vector)     {         matrix.Translate(vector.X, vector.Y);         return matrix;     }      /// <summary>     /// Scale the matrix by the given X/Y factors centered at the given point.     /// </summary>     /// <param name="matrix"></param>     /// <param name="scaleX"></param>     /// <param name="scaleY"></param>     /// <param name="point"></param>     /// <returns></returns>     public static Matrix ScaleAtPoint(Matrix matrix, double scaleX, double scaleY, Point point)     {         matrix.ScaleAt(scaleX, scaleY, point.X, point.Y);         return matrix;     } } 

1 Answers

Answers 1

So, I'm not a wpf programmer. But have a suggestion/workaround which could possibly work for you.

You could code the thing as follows:

  • set IsManipulationEnabled="True" (in this case OnTouchUp isn't fired for the grid colored in LightGreen)

  • Set OnTouchUp to fire on either Viewbox x:Name="Viewbox" or the Grid above this Viewbox (rather than for the 800x800 Grid)

  • So now OnTouchUp would be fired whenever you touch anywhere in the Viewbox (not just inside the LightGreen area)

  • When OnTouchUp is now fired, just check if the co-ordinates are in the region of LightGreen box. If YES-> update the time, if no, leave the time as it is.

I understand this is a workaround. Still posted an answer, in case it could prove useful.

Read More

MVC 5 - Mitigating BREACH Vulnerability

Leave a Comment

I'm hoping someone will be able to help my understanding of this issue and whether or not I need to take any extra steps to protect my application.

Reading up on this particular vulnerability, it seems to impact servers that match the following criteria:

  • Be served from a server that uses HTTP-level compression
  • Reflect user-input in HTTP response bodies
  • Reflect a secret (such as a CSRF token) in HTTP response bodies

It also seems that mitigation steps, in order of effectiveness are:

  • Disabling HTTP compression
  • Separating secrets from user input
  • Randomizing secrets per request
  • Masking secrets (effectively randomizing by XORing with a random secret per request)
  • Protecting vulnerable pages with CSRF
  • Length hiding (by adding random number of bytes to the responses)
  • Rate-limiting the requests

In the view of my page, I'm calling the helper method @Html.AntiForgeryToken which creates the corresponding input and cookie when I visit the form. From looking over what this helper method does, it seems to create a new, unique token each time the page is loaded, which seems to meet point 3 in the mitigation steps and the act of using a CSRF token in the first place meets point 5.

Disabling HTTP compression seems to be widely regarded as 'not good for performance' and from some other resources I've been reading, length hiding could possibly cause issues for functionality like file upload (which this page uses)


So, after all that, the only thing that I can really thing to look at now is separating secrets from user input. I thought about maybe trying to put the CSRF token value into the session.....or am I completely over-thinking this and is the current implementation of '@Html.AntiForgeryToken` good enough to protect us?

1 Answers

Answers 1

Yes if the CSRF token is random, then it mitigates the attack. As long as you aren't sending any other secrets with user input forms you should be okay.

Alternatively,

Disable compression for on pages that have user input is a possibility as well. Checkout this answer Can gzip compression be selectively disabled in ASP.NET/IIS 7?

Read More

Volley attach access token to evey request using singleton

Leave a Comment

I am doing the following which perfectly works

    //else proceed with the checks     JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(             Request.Method.GET,             checkauthurl,             null,             new Response.Listener<JSONObject>() {                 @Override                 public void onResponse(String response) {                           //do stuff here                 }             },             new Response.ErrorListener() {                 @Override                 public void onErrorResponse(VolleyError error) {                    // do stuff here                 }             }) {                 @Override                 public Map<String, String> getHeaders() throws AuthFailureError {                     HashMap<String, String> headers = new HashMap<String, String> ();                     TokenService tokenservice = new TokenService(ctx);                     String accesstoken = tokenservice.getToken(ApiHelper.ACCESS_TOKEN_SHARED_PREF);                     headers.put("Authorization", "Bearer " + accesstoken);                      return headers;               }     };      // Access the RequestQueue through your singleton class.     ApiSingleton strngle = new ApiSingleton(ctx);     strngle.addToRequestQueue(jsonObjectRequest); 

For every request, I have to add the request header. How can I set request headers directly in the singleton.

This is my singleton

private static ApiSingleton mInstance; private RequestQueue mRequestQueue; public static Context mCtx; private ImageLoader mImageLoader;  public ApiSingleton(Context context) {     mCtx = context;     mRequestQueue = getRequestQueue();     //do stuff }  public RequestQueue getRequestQueue() {     if (mRequestQueue == null) {         // getApplicationContext() is key, it keeps you from leaking the         // Activity or BroadcastReceiver if someone passes one in.         mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());     }     return mRequestQueue; } 

How do I avoid the above code duplication when attaching the bearer token in every request?

3 Answers

Answers 1

public class CustomJsonRequest extends JsonRequest<Object>{     public CustomJsonRequest(String url, String requestBody, Response.Listener<Object> listener,                        Response.ErrorListener errorListener) {         super(url, requestBody, listener, errorListener);     }      public CustomJsonRequest(int method, String url, String requestBody, Response.Listener<Object> listener,                        Response.ErrorListener errorListener) {         super(method, url, errorListener);     }     @Override     protected Response<Object> parseNetworkResponse(NetworkResponse response) {         return Response.success(Object, HttpHeaderParser.parseCacheHeaders(response));     }      @Override     public Map<String, String> getHeaders() throws AuthFailureError {         Map<String, String> headers = new HashMap<String, String> ();         TokenService tokenservice = new TokenService(ctx);         String accesstoken = tokenservice.getToken(ApiHelper.ACCESS_TOKEN_SHARED_PREF);         headers.put("Authorization", "Bearer " + accesstoken);         return headers;     } } 

You can extend JsonRequest class and override getHeaders() method. Pass instance of CustomJsonRequest object when you are adding volley requests in queue.

VolleyUtils.getInstance().addToRequestQueue(customJsonRequest);  

Answers 2

  1. You can write a "Factory" with a method that takes your checkauthurl and ctx and returns you an instance of the JsonObjectRequest. Your factory could implement some logic for re-use of objects that have the same auth Url if that makes sense in your case.
  2. You can sub-class JsonObjectRequest and provide your checkauthurl and ctx as a parameter to the constructor. Similarly, you can implement a scheme to re-use the objects

The factory would be the suggested approach if you want Dependency Injection.

I would recommend against pre-allocating the Token and using it in multiple requests. Tokens expire. If the TokenService is written well, it should know when tokens will expire and refresh as needed (if possible).

Answers 3

Make an AppController.java file and mention this file name as android:app in manifest tag.

public class AppController extends Application {      public static final String TAG = AppController.class.getSimpleName();     private RequestQueue mRequestQueue;     private static AppController mInstance;     private ImageLoader mImageLoader;      @Override     public void onCreate() {         super.onCreate();         mInstance = this;     }     public static synchronized AppController getInstance() {         return mInstance;     }      public RequestQueue getRequestQueue() {         if (mRequestQueue == null) {             mRequestQueue = Volley.newRequestQueue(getApplicationContext());         }         return mRequestQueue;     }      public ImageLoader getImageLoader() {         getRequestQueue();         if (mImageLoader == null) {             mImageLoader = new ImageLoader(this.mRequestQueue, new LruBitmapCache());         }         return this.mImageLoader;     }     public <T> void addToRequestQueue(Request<T> req, String tag) {         req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);         getRequestQueue().add(req);     }     public <T> void addToRequestQueue(Request<T> req) {         req.setTag(TAG);         getRequestQueue().add(req);     }     public void cancelPendingRequests(Object tag) {         if (mRequestQueue != null) {             mRequestQueue.cancelAll(tag);         }     } } 

Do the networking code

 StringRequest strReq = new StringRequest(Request.Method.POST, AppConfig.URL_BUYER_LOGIN,  new Response.Listener<String>() {                  @Override                 public void onResponse(String response) {                  }             }, new Response.ErrorListener() {                  @Override                 public void onErrorResponse(VolleyError error) {                  }             }) {                 @Override                 protected Map<String, String> getParams() {                  }             };             // Adding request to request queue             AppController.getInstance().addToRequestQueue(strReq, tag_string_req);         } 
Read More