background preloader

Android

Facebook Twitter

Android - How to configure VPN programatically? Jeff Sharkey » Modifying the Android logcat stream for full-color debugging. I’ve been keeping busy writing all sorts of fun stuff lately, but a few weeks ago I was really fighting with Android’s logcat debugging stream. It dumps out tons of useful information, but it’s easy to get lost in the flood of text. So I whipped up a quick Python script that reformats the logcat output into a colorful stream that is much easier to visually follow. One feature I really like is that it allocates unique colors for each “tag” used. This makes it really easy to visually separate dozens of tags into their source apps, and makes it easy to pick your app out in the crowd.

This was inspired by the irssi nickcolor script, and the best way to explain is using an example: There, isn’t that better? Just pipe your adb logcat output through the Python script to get started, or you can run the script directly to invoke adb: $ adb logcat | ~/coloredlogcat.py $ ~/coloredlogcat.py It only took about 30 minutes to write up, but it’s already saved me more than that in lost debugging time.

Android Security

Android Development: More Than a Lot of Google Maps Markers. The purpose of the article is to demonstrate a method on how to extend the capabilities of the Google Maps API on Android devices. Basically, Google Maps can render only a limited number of markers over the map, let’s say a few thousand, but with larger numbers it will start to lag and will ruin the user experience.

The method demonstrated below will allow android projects to render a few tens to a hundred thousand markers (with limitations on the marker variety). More Than a Lot of Markers on Google Maps for Android Source: The first approach – Ground Overlay with Bitmaps: The first idea was to create a bitmap which covers the visible area of the map and draw the markers on it using the Canvas class. Distance estimation After a few hours of research we found that the Haversine formula will give a really good estimate of the distance. The simplified Haversine implementation: Drawing fast – OpenGL ES 2.0.

GenyMotion

Android-screen-monitor - Android Screen Monitor. The Android Screen Monitor (ASM) is a tool to monitor screen on the device or emulator. ASM is an Android Debug Bridge (adb) client, When it starts monitoring screen, ASM connects to adb on port 5037 and receives frame buffer continuously on the device or emulator and transfer image to your desktop window. You can rotate and scaling monitor window and export a image into PNG file as screen shot tool. Mirroring an Android device screen onto your desktop (The Mobile Frontier)

Have you ever needed to show a screen from your Android device on a desktop? I recently faced a client scenario in my role as an IBM application developer in which I needed to do just that. I needed to show my progress on a particular development project to members of the client team who were at a remote location so that they could suggest any needed changes. The best way to achieve this was by sharing a mobile device screen onto my desktop (I couldn’t do this with the simulator because I was working on the camera functionality, which does not work in simulator), so I did some research on how mirroring a screen works in iOS, Android and BlackBerry. In my previous post I described how mirroring works on the iOS platform, and in this post I'll tell you how to do it in Android.

Figure 1: Mirroring a device onto the desktop How to mirror your screen in the Android platform Install any "VNC server" from Google Play (droid VNC server or android-vnc-viewer or similar). That's it. Various Development Tools in Android - Android Blazin. 1] Robotium: Robotium is a test framework created to make it easy to write powerful and robust automatic black-box test cases for Android applications. With the support of Robotium, test case developers can write function, system and acceptance test scenarios, spanning multiple Android activities.Robotium has full support for Activities, Dialogs, Toasts, Menus and Context Menus. Read More 2] AppXplore: With the AppXplore tool, you can go through all the apps installed on your Android device and dissect many application details – app version, package names, certificates, permissions, signatures, activities, and lots of other information that would not be normally viewable from the device.

AppXplore is especially useful for seeing how much memory an app is using, and if the file is movable to the SD card. Likewise, developers can use AppXplore for testing and quality assurance purposes, to make sure their apps are showing the proper permissions in the manifest file. Read More Read More. Device Metrics - Google Design. Google Proximity Beacons - Part 2 - NewCircle. The following discussion relates to library code available in Google Play Services v7.8. If you are using later versions of Play Services, the API surface area may have changed since this article was written.

We saw in the previous post how Google's Proximity Beacon API could be used to create and attach additional contextual data to the otherwise simple advertisement of a Bluetooth beacon. In this post, we are going to dive deeper into the client side. How do we get our user's devices to recognize these beacons and retrieve the information created by the beacon management admin? You can get the full sample code for the NearbyBeacons example discussed here on GitHub. As a quick review, we can supply one or more pieces of data that a client should receive when a particular beacon is observed using attachments.

I could create attachments containing JSON data, for example, representing offers in a retail store: This is what an example getforobserved request would look like over the wire:

GPS

Android-OpenCV. How to Customize Android UI Components. It is not uncommon for developers to find themselves in need of a UI component that is either not provided by the platform they are targeting or is, indeed, provided, but lacks a certain property or behavior. The answer to both scenarios is a custom UI component. The Android UI model is inherently customizable, offering the means to create custom UI components in various ways: Inherit an existing component (i.e. TextView, ImageView, etc.), and add/override needed functionality. For example, a CircleImageView that inherits ImageView, overriding the onDraw() function to restrict the displayed image to a circle, and adding a loadFromFile() function to load an image from external memory. Create a compound component out of several components.

This approach usually takes advantage of Layouts to control how the components are arranged on the screen. Case Study: The CalendarView Android provides a native CalendarView component. CalendarView in AppCompact.Light theme. Make Your Own 1. <? 2. 3. 4. Getting Started. Android Design Support Library. Posted by Ian Lake, Developer Advocate Android 5.0 Lollipop was one of the most significant Android releases ever, in no small part due to the introduction of material design, a new design language that refreshed the entire Android experience. Our detailed spec is a great place to start to adopt material design, but we understand that it can be a challenge for developers, particularly ones concerned with backward compatibility. With a little help from the new Android Design Support Library, we’re bringing a number of important material design components to all developers and to all Android 2.1 or higher devices.

You’ll find a navigation drawer view, floating labels for editing text, a floating action button, snackbar, tabs, and a motion and scroll framework to tie them together. Navigation View You use NavigationView as DrawerLayout’s drawer content view with a layout such as: The simplest drawer menus will be a collection of checkable menu items: Floating labels for editing text Snackbar. Android BroadcastReceiver. Android BroadcastReceiver - Tutorial Copyright © 2011, 2012, 2013 vogella GmbH Using BroadcastReceivers in Android This tutorial describes how to create and consume Android services.

It is based on Eclipse 4.3, Java 1.6 and Android 4.2. A broadcast receiver (short receiver) is an Android component which allows you to register for system or application events. For example, applications can register for the ACTION_BOOT_COMPLETED system event which is fired once the Android system has completed the boot process. A receiver can be registered via the AndroidManifest.xml file. Alternatively to this static registration, you can also register a receiver dynamically via the Context.registerReceiver() method.

The implementing class for a receiver extends the BroadcastReceiver class. If the event for which the broadcast receiver has registered happens, the onReceive() method of the receiver is called by the Android system. 1.3. 1.4. Since Android API 11 you can call the goAsync() method. 1.5. Tip Table 1. Android - How to use PendingIntent to communicate from a Service to a client/Activity. Android Services. Android Services - Tutorial Copyright © 2011, 2012, 2013 vogella GmbH Developing own services and using system services in Android This tutorial describes how to create and consume Android services. It is based on Eclipse 4.3, Java 1.6 and Android 4.4. A service is a component which runs in the background without direct interaction with the user.

As the service has no user interface, it is not bound to the lifecycle of an activity. Services are used for repetitive and potentially long running operations, i.e., Internet downloads, checking for new data, data processing, updating content providers and the like. Services run with a higher priority than inactive or invisible activities and therefore it is less likely that the Android system terminates them. It is possible to assign services the same priority as foreground activities. 1.2.

By default, a service runs in the same process as the main thread of the application. 1.3. 1.4. 2. 2.1. 2.3. Tip 2.4. Table 1. 3. 4.1. 4.2. 5. 5.1. 5.2. Note 6. Using the Android action bar (ActionBar) Using the Android action bar (ActionBar) - Tutorial Based on Android 4.4 Copyright © 2009, 2010, 2011, 2012, 2013, 2014 vogella GmbH Using the action bar in Android applications This tutorial describes how to use the action bar in your Android applications. 1. 1.1. The action bar (ActionBar) is located at the top of the activity.

The action bar is enabled for devices which specify a target SDK of API version 11 or higher. Applications with a target SDK version less than API 11 use the options menu if such a button is present on the device. The following screenshot shows the action bar of the Google+ Android application with interactive items and a navigation bar. 1.3. The action bar has been introduced in Android 3.0. First, you can use the Open Source project called ActionBar Sherlock which allows you to use the action bar on Android devices as of Android 1.6. 2.1. Entries in the action bar are typically called actions. Tip 2.3. 2.4. 3. 3.1. 3.2. 3.3. 3.4. 3.5. Android Intents. Intents are used to signal to the Android system that a certain event has occurred. Intents often describe the action which should be performed and provide data upon which such an action should be done. For example, your application can start a browser component for a certain URL via an intent.

This is demonstrated by the following example. String url = " Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); But how does the Android system identify the components which can react to a certain intent? A component can register itself via an intent filter for a specific action and specific data. An intent filter specifies the types of intents to which an activity, service, or broadcast receiver can respond to by declaring the capabilities of a component. Android components register intent filters either statically in the AndroidManifest.xml or in case of a broadcast receiver also dynamically via code. 3.1. 3.2. Image - Android: Resize a large bitmap file to scaled output file. Bitmap - How to resize Image in Android? Creating a Navigation Drawer. The navigation drawer is a panel that displays the app’s main navigation options on the left edge of the screen.

It is hidden most of the time, but is revealed when the user swipes a finger from the left edge of the screen or, while at the top level of the app, the user touches the app icon in the action bar. This lesson describes how to implement a navigation drawer using the DrawerLayout APIs available in the Support Library. Navigation Drawer Design Before you decide to use a navigation drawer in your app, you should understand the use cases and design principles defined in the Navigation Drawer design guide. Create a Drawer Layout To add a navigation drawer, declare your user interface with a DrawerLayout object as the root view of your layout. Inside the DrawerLayout, add one view that contains the main content for the screen (your primary layout when the drawer is hidden) and another view that contains the contents of the navigation drawer. Initialize the Drawer List. Android Development.

Android and Electronics

Kirill Grouchnikov - Google+ - Now that we've talked about enabling the action bar overlay… Now that we've talked about enabling the action bar overlay mode [0] and doing parallax scrolling effects [1], it's time to take a look at the integration between action bar overlays and the side drawer [2]. If you don't use side drawer in your app, you can stop reading now. First up, you're going to need to set explicit top padding on the layout you're using for the side drawer content. As mentioned in [0], once you enable the action bar overlay mode, your main content goes below the action bar.

Your main layout would be either DrawerLayout or an extension of that class. While that works for the content itself (starting from the hero element at the very top), you wouldn't want the action bar be displayed on top of the first item in the drawer. To set the correct platform-specific padding, use ? Android:attr/actionBarSize as the top padding of your drawer. Next, you're going to need to listen to side drawer sliding open and close and update the action bar background alpha. Software.intel. Android clipboard code that works on all API levels.

Libraries

SFAndroid. From ADempiere ERP Wiki Spin-Suite (Dynamic Application Mobile with ADempiere ERP & CRM) Dynamic Application Mobile from ADempiere with Android S.O (for now). Also is full OffLine. The success of one organization is linked to its technological inversion, nowadays is essential to use tools that provide us a wide coverage on the field of Purchasing, Storage, Production, Marketing, Sales and Distribution, that is added to the neccesity of handling the control of each process in the organization. ERP´s such as Adempiere CRM & SCM, cover a large part of this neccesity. Application Demo for Android (Google Play): Apk - How to check if the application is installed or not in android programmatically.

Android - how to install apk file programmatically. Self upgrading own apk via net programmatically on android. Android - APK Signature check programmatically in runtime. Android Sending and Receiving data from remote server using IntentService. Android Charting Library. Android charts. Removing the pain points from Android development. Memory Analysis for Android Applications.