Archive for the ‘Google Apps’ Category

B4A-Bridge-Relay by 12Lab

January 4, 2014

App: B4A-Bridge-Relay, B4A-Bridge-Relay-Free

Published: January 2014

Having 3 or more devices (or even 2!) on which to test an application in development is presently cumbersome from the B4A IDE (as of 3.2). I realized that a few changes to B4A-Bridge would save many iterations through the IDE. In a private communication with the principal, Erel Uziel, Anywhere Software approved derivative works based upon Anywhere Software posted source on the B4A/B4PPC forums. With B4A-Bridge-Relay, deploying an app to more than one device takes essentially no more time than it does with just one.

The existing B4A-Bridge (2.10) was refactored to separate the Service framework from the B4A-Service functionality, a new Class added for downstream connections, and packet counting was added to the apk deployment transfer, so progress can be monitored as necessary. You get confirmation that the transfer to the -Relay started, then you can turn your attention elsewhere. If you find yourself in a ‘poor’ WiFi environment, this will also save you some guessing. The ‘H’eartbeat indicator will also assist with this situation, and the colored status text makes it easy to tell at a glance. If you use B4A-Bridge-Relay on all client devices, you can observe the transfer to each device.

B4A-Bridge-Relay also displays additional Server information as compared to the standard B4A-Bridge. In WiFi mode, the port used is displayed after the IP address. In Bluetooth mode, the MAC Address and the Name are displayed. These identifiers are helpful in certain situations.

Use:

Short Press of the “Skip Clients” button will tell the Service to not use the application client list, Long Press will allow view/delete of clients from the application’s client list. “Use Clients” functionality is maintained; Short Press tells the Service to use the application’s client list, Long Press allows adding a new client to the application’s client list. Changes to the application client list are immediately applied to the Service list; however, after entering any desired clients, press F2 in the B4A IDE to force all clients to ‘connect’.

When adding a client address, you can now use a range or the ‘*’ wildcard in the last segment. 192.168.2.4-8 will auto-populate clients .4,.5,.6,.7,.8. The end of the range can be left off, in which case it defaults to -254. If the wildcard is used, such as 192.168.2.* , then .2,.3,…,.253,.254 is auto-populated. If some of those IP addresses in the range do not actually have a real associated target device, that is fine; B4A-Bridge-Relay will just skip over them if the IDE-initiated connection attempt fails. Entering the device’s address as a client will be ignored, as will any duplicate client addresses; this also functions as a cancel operation.

The Status area shows the first few connected clients in the  client list. To see the full list, long-press on Skip Clients, scroll through it as needed, then cancel when finished.

Note:

At least some older phones (example, HTC WildFire running Android 2.3.5) may hang a port open; this can be identified by use of port 6906 when the WiFi service is started. The application displays “My IP: A.B.C.D:port” when Start-Wifi is pressed. Port is usually 6789, except when it isn’t available, and then it uses port 6906. Currently it is not possible to set the port for a client in the Relay application, it always uses the default of 6789.  Since the original B4A-Bridge is registered as a different application in Android, you may have one of them running holding the port open, and if its Service is running, the Relay (or the IDE) will connect to it on port 6789. Fix is to clear the in-use/hung port by either stopping the offending application/service, or rebooting the phone.

Updates:

2014/09/12 v2.10.10: “-Free” updated with improved layout.

2014/07/27 v2.10.9: “-Free” updated with changed “Wake Lock” behavior; The lock is no longer released when the Activity is paused. Use the Exit button to release the lock and exit the application. This is to fix a Compile/Run deployment issue, the android may go to sleep when B4a-Bridge-Relay-Free is paused to switch to installation. If this is found acceptable by users it will be added to the paid version.

2014/06/29 v2.10.8: Added “-Free” version so there is no direct cost to try -Relay out.

2014/06/28 v2.10.7: Added “Wake Lock”, keep the device from sleeping, while UI is up.

2014/02/13 v2.10.6: Added Tablet friendly layout, connection ‘H’eartbeat indicator and colored status.

2014/02/10 v2.10.4-5: Enhancement; Bug Fixes. In some modes, such as Portrait, the Phone keyboard is used, to make it easier to enter addresses. Keyboard is now auto-displayed when adding a client. IP entry has validation. When IP address range and wildcard was added (v2.10.3), the ability to enter a standard IP address was broken. This is now fixed. 2.10.4 did not accept IP address segments with value of 0. Fixed.

2014/01/28 v2.10.3 Update: Added a new feature where a range or wildcard can be used in the last IP address segment when adding client(s). See above for more details on how this is entered.

2014/01/11 v2.10.2 Update: Testing of the BT server mode uncovered a bug that was preventing the BT mode from starting; instead it would start the Wifi mode. Issue has been corrected. An enhancement is also in this release: Server ID (identification) displayed continues to show the Wifi IP address for Wifi mode (displayed as IP:Port), but now displays the BT MAC and Name for BT mode.

2014/01/08 v2.10.1 Update: “Clear Clients” button in v2.10 not only removed the client list from the Service, it was also unintentionally clearing the application’s backing list of clients. The intention is to have the application maintain a list of clients, irregardless of whether the Service was actively using the list. Issue is corrected; the button is now relabeled as “Skip Clients”. Also, “Start-Wifi” was not starting the Service on the correct port, until “Stop” was pressed and “Start-Wifi” pressed again. Corrected.

2014/01/04 v2.10 Initial release: is based upon B4A-Bridge v2.10. Added Apk transfer packet counting/display. Added downstream clients. Wifi mode has been tested, Bluetooth functionality not changed. This version is made available to support multiple WiFi connected client devices.

Apk transfer ‘progress’ code addition is available at: http://www.basic4ppc.com/android/forum/threads/b4a-bridge-source-code.8153/page-2#post-212716. See page-1 post 18-20 for details on 2.09, 2.10.

Release Note is at: http://www.basic4ppc.com/android/forum/threads/b4a-bridge-relay-by-12lab-download-apk-from-b4a-ide-to-multiple-device-targets.36440/

If you find this useful beyond the low cost to you in Google Play, please consider a donation.

Please consider a donation if you find value in my free/open source contributions.

Advertisements

ClsWheel 1.7

September 25, 2013

Class, B4A: ClsWheel, Type 5 = DIGITS

Published September 2013

I’ve been using B4A for several projects, including MIR-Blue. After finding out that Modal Dialogs cause a message ordering problem for AsyncText, I needed some reusable non-modal controls to replace the (modal) Dialogs library I first used. Klaus has written ClsWheel which I found very useful (Thanks Klaus!); but I found that while it handled Dates, multiple ‘wheel position’ elements and such, there was some boilerplate code required to use the CUSTOM mode for a simple multiple digit decimal number.

So I coded up a solution for it, providing an optional decimal point position specification. Mode 5 DIGITS accepts a 1-5 digit decimal number (with decimal point), and returns the same. The return can be assigned to an Int, Float or Double if desired, without extra processing. By default, ClsWheel uses a Space ” ” separator between wheel ‘digits’.

Of course I make this freely available, how could I not after Klaus’s contribution.

Update: Klaus accepted it, and is giving it his own spin, adding support for +-, movable decimal point, and other useful features.

Since there are some costs to me for these efforts, if you find value in any of my work, please consider a donation.

Please consider a donation if you find value in my free/open source contributions.

MIR-Blue

September 7, 2013

App: MIR-Blue, Google Play Store

Published: September 2013

The application name is a play on my last name, my avatar name, and “My IR-Blue”. My previous post documents another Google Play app written for the IR-Blue hardware, the same hardware my MIR-Blue app is written to. The hardware is one of the deliverables from the Kickstarter project.

From my last post:

The Kickstarter hardware had been delivered mid-Summer, but when I began using it with 0.86 from Google Play I experienced some issues including lockups and errant behavior, as well as tiny fonts that made it more difficult than necessary to read. I began working with the 0.60 source in August 2013, when time freed up from more pressing issues. Upon discovering even more shortcomings of that open sourced code, and desiring more features than available even in 0.86 as well as corrections to the issues I experienced on my HTC Sensation, I set about creating my own application. I used the open sourced 0.60 as the baseline, improving and extending it. I also reported some issues I discovered in 0.60 source and the 0.86 apk in to the original author, along with suggestions for improvements — some based upon my own design and code changes to 0.60 baseline.

I forked the IR-Blue github. The wiki there documents the changes I implemented upon 0.60, and culminated in an apk in the Google Play store, called MIR-Blue, available for Free. The post documenting it is at MIR-Blue.

I wrote a number of new Classes and a Service, which I can share with my other upcoming projects, and reworked the MIR-Blue source to use them. Once they are well tested I intend to release those that others may find useful. [Update: a first addition ClsWheel 1.7 is proposed to Class author]

Since there are some costs to me for these efforts, if you find value in any of my work, please consider a donation.

Please consider a donation if you find value in my free/open source contributions.

FIRsensor by MarDaSo

September 7, 2013

App: FIRsensor, Google Play Store

Published: July 2013

This is a free (as Andy Rawson stated: “free as in beer”) application written by Marcel Damhuis of The Netherlands. As of this writing it is at version 0.86. The source for this version is not posted to the Kickstarter github.

There is a github associated with the Kickstarter, the link provided is to the Android software portion. It begins with the source code as it was at version 0.60, and there is a set of apk’s for revisions up to 0.86 in the git.

The Kickstarter hardware had been delivered mid-Summer, but when I began using it with 0.86 from Google Play I experienced some issues including lockups and errant behavior, as well as tiny fonts that made it more difficult than necessary to read. I began working with the 0.60 source in August 2013, when time freed up from more pressing issues. Upon discovering even more shortcomings of that open sourced code, and desiring more features than available even in 0.86 as well as corrections to the issues I experienced on my HTC Sensation, I set about creating my own application. I used the open sourced 0.60 as the baseline, improving and extending it. I also reported some issues I discovered in 0.60 source and the 0.86 apk in to the original author, along with suggestions for improvements — some based upon my own design and code changes to 0.60 baseline.

I forked the IR-Blue github. The wiki there documents the changes I implemented upon 0.60, and culminated in an apk in the Google Play store, called MIR-Blue, available for Free. The post documenting it is at MIR-Blue.

Since there are some costs to me for these efforts, if you find value in any of my work, please consider a donation.

Please consider a donation if you find value in my free/open source contributions.