Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Getting started & Tutorials
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4android Getting started & Tutorials Android development starts here. Please do not post questions in this sub-forum.

DBUtils - Android databases are now simple!

Reply
 
LinkBack Thread Tools Display Modes
  #51 (permalink)  
Old 01-09-2012, 09:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I guess that the emulator you set was configured without a storage card. Create a new emulator (AVD) and set the storage card size to 16mb.
Reply With Quote
  #52 (permalink)  
Old 01-09-2012, 10:04 AM
Basic4ppc Veteran
 
Join Date: Sep 2008
Location: Brisbane, Australia
Posts: 316
Default Thanks

my new username wouldn't work for some reason.

This is my old one from my b4ppc days on my win phone 6.1 lol

I recreated the emulator and it works. Thanks

regards, Ricky
Reply With Quote
  #53 (permalink)  
Old 01-20-2012, 08:55 PM
Basic4ppc Veteran
 
Join Date: Sep 2008
Location: Brisbane, Australia
Posts: 316
Default executehtml question

I am wondering what the list argument in the call is? I've tried to search but it's not anywhere.
Regards, Ricky
Reply With Quote
  #54 (permalink)  
Old 01-22-2012, 06:44 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You can open the DBUtils module and see the method (or you can select the method and press F7 to get to the method or you can press Ctrl + E and write this method name).

See this post for more information about the "clickable" parameter: http://www.basic4ppc.com/forum/basic...html#post50625
Reply With Quote
  #55 (permalink)  
Old 02-04-2012, 07:09 AM
Senior Member
 
Join Date: Nov 2007
Location: Chorley, Lancs, UK
Posts: 152
Default HTML Column Width

In the ExecuteHtml sub routine, I assume the width of the columns is based on the column name. Is it possible to make this width greater, so that longer text items display in a more readable way?
__________________
Steve
Samsung Galaxy S(2.2) / Samsung Galaxy Tab 7" / HTC Touch Diamond 2 / HTC Exec

SpringfieldSoftware
Reply With Quote
  #56 (permalink)  
Old 02-05-2012, 06:19 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The width is set automatically by WebView. It considers both the title and the cells text.

If you want to manually set the width you can modify ExecuteHtml sub.
For example to set the second column width you can use this code:
Code:
For i = 0 To cur.ColumnCount - 1
        
If i = 1 Then
            sb.Append(
"<th style='width:200px;'>").Append(cur.GetColumnName(i)).Append("</th>")
        
Else
            sb.Append(
"<th>").Append(cur.GetColumnName(i)).Append("</th>")
        
End If
    
Next
Reply With Quote
  #57 (permalink)  
Old 02-06-2012, 03:09 PM
Senior Member
 
Join Date: Nov 2007
Location: Chorley, Lancs, UK
Posts: 152
Default

I tried this and it did not make any difference.

The resulting table has three columns of equal width, which appears to be dictated by the width of the webview.

Is it possible to produce wider tables, as we have the ability to zoom in or out anyway?
__________________
Steve
Samsung Galaxy S(2.2) / Samsung Galaxy Tab 7" / HTC Touch Diamond 2 / HTC Exec

SpringfieldSoftware
Reply With Quote
  #58 (permalink)  
Old 02-07-2012, 07:15 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The table width is set by the value of HtmlCSS variable.
Reply With Quote
  #59 (permalink)  
Old 02-07-2012, 03:44 PM
Senior Member
 
Join Date: Nov 2007
Location: Chorley, Lancs, UK
Posts: 152
Default

Excellent. Thanks for that Erel. I've set my report width to 150% and it works fine now.
__________________
Steve
Samsung Galaxy S(2.2) / Samsung Galaxy Tab 7" / HTC Touch Diamond 2 / HTC Exec

SpringfieldSoftware
Reply With Quote
  #60 (permalink)  
Old 03-13-2012, 12:17 PM
Penko's Avatar
Basic4ppc Veteran
 
Join Date: Feb 2012
Location: Plovdiv, Bulgaria
Posts: 214
Send a message via Skype™ to Penko
Default

Erel, what is the reason to lowercase the database field names in ExecuteMap?

I was searching for an error in my code until I used Log for my map object only to see that my key is "list" instead of "LIST".

I am just asking if there is any reason to do so provided that I use uppercase fields when designing databases(no matter MySQL, SQLite or anything else) because it's easier to read them(at least for me).

Of course I can pass the lowercase value of my name but I wondered why is this?

Edit: I have another question. By returning "Null" in various occassions, what is the best way to get my results? I've used:

Code:
txtFileName.Text = values.Get("list")
    txtNotes.Text = values.Get(
"notes")
This crashes when my database field is empty. I had to apply the following change to DBUtils in order to make it return a blank string which won't crash my application.

Code:
Dim val As Object
    
    
For i = 0 To cur.ColumnCount - 1
    
    val = cur.GetString2(i)
    
    
If(val = NullThen
        val = 
""
    
End If

        res.Put(cur.GetColumnName(i).ToLowerCase, val)
    
Next
Unfortunately, it won't work for INTEGER.
__________________
HTC Desire running Android 2.2

Last edited by Penko : 03-13-2012 at 01:31 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Android SlidingPanels - Simple way to create sliding layouts Erel Basic4android Getting started & Tutorials 76 05-09-2012 11:44 PM
Anyone can help me design one simple Android Apps with Basic4android LouieChan Basic4android Updates and Questions 5 04-16-2012 12:32 AM
Syncing Databases JasonPoS Forum Discussion 0 10-12-2010 10:15 PM
Attaching databases mozaharul Questions (Windows Mobile) 1 06-17-2010 06:42 PM
Synchronising databases BjornF Questions (Windows Mobile) 2 10-18-2007 07:26 AM


All times are GMT. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0