How to use Charles Proxy in Xamarin to capture network traffic (including SSL)
Diego Ponce de León
by
3y ago
Capturing network traffic between your application and your server is a handy way of checking and debugging the data you are sending and what comes back from the server. Charles Proxy shows network calls in a sequence or as a tree structure, including headers and all kind of http information like response times and payload size. It even allows you to simulate adverse network conditions and throttling, ie: an unstable 3g connection. I´ve been doing this forever on web development so I tried on mobile by configuring a proxy on Android emulators according to some detailed tutorials out there. Re ..read more
Visit website
Android 8 adaptative (vector) icons
Diego Ponce de León
by
3y ago
Once we change the target android version to 26 or higher, the app icon suddenly gets messed up, from a full size icon to a tiny, hard to notice thing inside a white shape (a circle on the default Google launcher). I delayed upgrading to 26+ because of this, and also beacuse I didn´t understand how the new adaptative icons work. But it´s about time, so here we go. How do I create it? I´m assuming your launcher icon (app icon) is called ic_launcher, but it can be any name actually. Just make sure it´s the same name you set on your main launcher activity: [Activity( Label = "YourApp ..read more
Visit website
Fixing push notifications on Android 8. Aka channels
Diego Ponce de León
by
3y ago
Upgrading your target SDK to 26+ (Android 8) can break your push notifications all of a sudden. Fortunatelly it´s very easy to fix. Android 8 (API level 26) expects any notification to use a Channel. So we need to implement them but only when the API level is 26+. Channels should be ignored otherwise because they won´t be available, meaning that your app will throw an exception if you try to use them. We will create a default channel to be used when any push notification arrives. You can actually create multiple channels but I bet most applications will be just fine with one. public static cl ..read more
Visit website
UIStackView magic
Diego Ponce de León
by
3y ago
This component is one of the things that should´ve been there for ages, as it facilitates layout design considerably. In every UI environment there is a basic need to stack elements horizontally or vertically, having them rearranged when any element is added or removed. This takes a second in other platforms however iOS auto-layout is some times a painful process for pretty simple tasks. What´s wrong with the good old, super awesome AutoLayout? Consider the following layout (“–” represents padding): |--view1--view2--view3--| Doing this silly layout the “old” way involves lots of constraints ..read more
Visit website
Getting fancy with UIView anchors and state changes
Diego Ponce de León
by
3y ago
If you prefer coded user-interfaces rather than designers (Xcode Interface Builder or Xamarin designers) you will surely like this API (available from iOS9+). It´s very readable, easy to maintain and feels more natural compared to the old one. Every UIView has now a number of NSLayoutAnchor properties that can be used to create constraints (NSLayoutCostraint): Creating a constraint does not mean it will be active by default and you´ve got do it explicitly: var c = origin.CenterXAnchor.ConstraintEqualTo(target.CenterXAnchor); c.Active = true; // or just origin.CenterXAnchor .Constrain ..read more
Visit website
How to use Charles Proxy in Xamarin to capture network traffic (including SSL)
Diego Ponce de León
by
3y ago
Capturing network traffic between your application and your server is a handy way of checking and debugging the data you are sending and what comes back from the server. Charles Proxy shows network calls in a sequence or as a tree structure, including headers and all kind of http information like response times and payload size. It even allows you to simulate adverse network conditions and throttling, ie: an unstable 3g connection. I´ve been doing this forever on web development so I tried on mobile by configuring a proxy on Android emulators according to some detailed tutorials out there. Re ..read more
Visit website
A simple page-indicator for your android view-pager
Diego Ponce de León
by
3y ago
Every app I did needed some kind of slider, like on-boards or walkthroughs, product sliders, help tutorials, photo slide-shows, etc. In the past I´ve done some view pagers with those circle page indicators in Android that involved using either 3rd party libraries or a ton of code. That was before Lollipop came out. This is now very obvious and ridiculously simple but I´m sharing it here in case you don´t know about it. With a little xml we are going to convert this: into something like this: Making the connection between the view-pager and our page indicator (TabLayout) takes a single line ..read more
Visit website
Android 8 adaptative (vector) icons
Diego Ponce de León
by
3y ago
Once we change the target android version to 26 or higher, the app icon suddenly gets messed up, from a full size icon to a tiny, hard to notice thing inside a white shape (a circle on the default Google launcher). I delayed upgrading to 26+ because of this, and also beacuse I didn´t understand how the new adaptative icons work. But it´s about time, so here we go. How do I create it? I´m assuming your launcher icon (app icon) is called ic_launcher, but it can be any name actually. Just make sure it´s the same name you set on your main launcher activity: [Activity( Label = "YourApp ..read more
Visit website
Large file downloads on Windows 10 mobile
Diego Ponce de León
by
3y ago
To download big files correctly (especially on mobile devices) we should try to achieve the following goals: Separate the download process from the current view in a background task: we don´t want the download to stop if we navigate to another view or the device goes idle The download stream should not write directly to memory: the device may run out of memory very soon, crashing your app. Instead, we should write to the file system directly as soon as the bytes are downloaded. Report progress: users should know how long it will take to finish. Otherwise it may look like it´s stuck The same ..read more
Visit website
Fixing push notifications on Android 8. Aka channels
Diego Ponce de León
by
3y ago
Upgrading your target SDK to 26+ (Android 8) can break your push notifications all of a sudden. Fortunatelly it´s very easy to fix. Android 8 (API level 26) expects any notification to use a Channel. So we need to implement them but only when the API level is 26+. Channels should be ignored otherwise because they won´t be available, meaning that your app will throw an exception if you try to use them. We will create a default channel to be used when any push notification arrives. You can actually create multiple channels but I bet most applications will be just fine with one. public static cl ..read more
Visit website

Follow Diego Ponce de León on FeedSpot

Continue with Google
Continue with Apple
OR