Share My Creation First App in B4A: ShareTotals

Here's my first App in B4A:

NEW Android App “SHARETOTALS”

For me it was a learning project to get comfortable with Basic4Android.

It took me a few weeks from zero to the market, especially with the wonderful and kind community around Erel.

As a noobie to B4A I had no problem to implement the following parts I've found here in the forums:

-AHPreferenceManager
-AHPreferenceScreen
-AHViewPager Slidepanels
-Reflection
-SQL Database with all kind of transactions
-DBUtils
-StringUtils
-ActionListModul
-Handle the FileSystem
-Import/Export CSV
-DesignerScript
-TTS
-NinePatch graphics
-Intents for sharing data with the cloud
-Scrollview with subviews and events
-Systemdialogs for files and numbers
-and a lot of hints from the gurus on the Basic4Android forum!

In conclusion I must say that Basic4Android is very easy to learn and it's fun to handle the available libraries and modules. Buying the full Version of Basic4Android was my best investment in software productivity in the last 20 years!







------------
Please don't yell at me for taking money on Google Play, but I need to sell apps to make a living of it and to support our handicapped son. :eek:

https://play.google.com/store/apps/details?id=com.rolloapps.sharetotals
 

Attachments

  • ShareTotals-01_(1280_x_1024).jpg
    ShareTotals-01_(1280_x_1024).jpg
    73.4 KB · Views: 9,979
  • ShareTotals-02_(1280_x_1024).jpg
    ShareTotals-02_(1280_x_1024).jpg
    68.1 KB · Views: 579

Harris

Expert
Licensed User
Longtime User
I would like to know how you created such a nice and clean layout - bubble buttons, background and such...
 

fredo

Well-Known Member
Licensed User
Longtime User
I would like to know how you created such a nice and clean layout - bubble buttons, background and such...

Thanks for your interest Harris.

The Background is a seamless texture from a stockphoto seller and the glossy Buttons are made with Gimp.

Gimp works with multiple Layers with controllable transparency. It takes a few days to climb the learning curve. But with great help from some youtube videos you will be going to love this tool.

The button images are marked with a ninepatch frame (also with Gimp) an implemented with Erels tutorial.

And naturally Erels wonderful Designer Script features.

Best regards,
Fredo
 

Harris

Expert
Licensed User
Longtime User
Thanks for all of this Fredo.

I have used Gimp, but only for simple things. It does seem very powerful.

I shall check out all and try.

I just viewed the shiny button tutorial - very interesting indeed.
Quick Question: Can I create a stock shiny button, use/resize/add text through the B4A button view?
(or must each button be sized and labelled accordingly)

Thanks
 
Last edited:

Harris

Expert
Licensed User
Longtime User
A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths. A NinePatch drawable is a standard PNG image that includes an extra 1-pixel-wide border. It must be saved with the extension .9.png, and saved into the res/drawable/ directory of your project.



Ok, to answer my question above, I shall try this direction.

Thanks
 

fredo

Well-Known Member
Licensed User
Longtime User
Yepp, NinePatch is the only right way to deal with stretchable images (buttons).

Have a look also on the explanations of AndroidDom or radleymarx or Android10.

If your PNG files are ready to go, then:
-put them in "\Objects\res\drawable\"
-make sure the names are not longer than 8 characters
-make sure the characters are all lowercase
-make sure the last two characters of the names are ".9" (for example "picabc.9.png")
-make sure they are "read only"

In your source you call
B4X:
  ...
  zzz.LoadLayout("1")
  SetNinePatchDrawable(imgStart, "picabc")
  ...

Notice that the ImageName in the code is used without the ".9.png" extension.

Best regards,
Fredo
 

Harris

Expert
Licensed User
Longtime User
I am having trouble getting the draw9patch.bat to fire up the app.

here are the contents of the batch file:


@echo off
rem Copyright (C) 2008 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0

rem Check we have a valid Java.exe in the path.
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

set jarfile=draw9patch.jar
set frameworkdir=
set libdir=

if exist %frameworkdir%%jarfile% goto JarFileOk
set frameworkdir=lib\

if exist %frameworkdir%%jarfile% goto JarFileOk
set frameworkdir=..\framework\

:JarFileOk

set jarpath=%frameworkdir%%jarfile%

call %java_exe% -Djava.ext.dirs=%frameworkdir% -jar %jarpath% %*



My DOS is a little rusty. To I have to specify some paths to get it to run?

You mentioned that I can create the same (nine patch requirements) with Gimp. I have only seen examples doing this with the draw9patch util.

Thanks
 

Harris

Expert
Licensed User
Longtime User
It appears that the swing-worker.jar is missing from the $ANDROID_SDK/tools/lib folder; putting this jar (for example from http://netmite.com/android/mydroid/1.6/prebuilt/common/swing-worker/swing-worker-1.1.jar
) into that directory fixed the issue


That fixed it...

Now I have to save my png to capture just the button created - as opposed to the large workspace Gimp provided when creating the button from the Youtube example...

Thanks
 

Harris

Expert
Licensed User
Longtime User
Finally got this 9 patch thing figured out. I have buttons and panels than now look great - instead of plain/boring. Richard Lalancette has created many great ones for us to use.

However, when I tried them in the emulator with 800x480 1.5 density, they blurred and deformed??? Look great on my Nexus 7 with 1.33 density.

I also managed to get designer scripts working for me. Now my layouts fit right on all device sizes. What a blessing....

Thanks
 

luke2012

Well-Known Member
Licensed User
Longtime User
Look & Feel

Very compliments 4 your application.

Where you got the amazing transparent graphics that you are using ? :)
 
Top