Bitcoin Forum
September 26, 2016, 05:22:39 AM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Working Android App  (Read 6752 times)
rodin
Newbie
*
Offline Offline

Activity: 14


View Profile
July 22, 2010, 08:56:59 AM
 #1

App is now available on the Android Market. Look for Bitcoin.
Now that we have RPC passwords, I am tunneling bitcoind over SSL, and can query the daemon from anywhere. So, I whipped together an Android app that provides access to the API. At this point, I am just calling "getinfo" and parsing the output, which I think demonstrates the basic functionality needed for a complete app. I'm attaching a fresh screenshot, straight from my Nexus One. I'll be hacking more features in over the next few days.

If you
  • are running the headless client on a server somewhere,
  • have an Android device,
  • want to help with beta testing,
  • and will have lots of patience with my schedule...
Then I would love three or four volunteers to help with testing and to suggest fixes and improvements.



http://lh6.ggpht.com/_UKhaNEggorc/TFB33WDsTzI/AAAAAAAACF8/DxTKgsyIwEY/Screen%20shot%202010-07-27%20at%2012.12.14%20PM.jpg                  http://lh3.ggpht.com/_V_rsvdR-i6I/TEgS-Vl95CI/AAAAAAAAABI/pDOxwZh7kaY/s512/BitcoinAppIcon.png


For reference, here's how I've set up my Ubuntu server:

1. I created a startup script, /etc/init.d/bitcoind-ssl. It looks like this:

#!/bin/sh -e

##
# /etc/init.d/bitcoind-ssl
##

[ -x /usr/local/bin/bitcoind ] || exit 0
. /lib/lsb/init-functions
. /etc/default/rcS

#The port on which the SSL tunnel will run
PORT=38332
#Run as this user.
USER=rodin

case "$1" in
    start)
   log_begin_msg "Starting bitcoind..."
   su $USER -c ~$USER/bin/bcstart
        /usr/bin/stunnel -d $PORT -r 8332
   ;;
    stop)
   log_begin_msg "Stopping bitcoind..."
   su $USER -c ~$USER/bin/bcstop
   echo Waiting for server to shutdown cleanly...
   sleep 2
   fuser -n tcp $PORT -k
   ;;
    restart|force-reload)
   su $USER -c ~$USER/bin/bcstop
   echo Waiting for server to shutdown cleanly...
   sleep 2
   fuser -n tcp $PORT -k
   su $USER -c ~$USER/bin/bcstart
        /usr/bin/stunnel -d $PORT -r 8332
   ;;
    status)
   su $USER -c ~$USER/bin/bcstatus
   ;;
    *)
   echo "Usage: /etc/init.d/bitcoind-ssl {start|stop|restart|force-reload}"
   exit 1
   ;;
esac

exit 0


2. I made three scripts in ~/bin, bcstart, bcstop, and bcstatus. The names are pretty descriptive. These scripts contain my password but are only readable by me and root, so that's relatively safe (esp. since I'm root).

3. I scheduled the init script to start at boot-time. You can do something like sudo update-rc.d bitcoind-ssl defaults.

And, just for completeness, I use logrotate to simultaneously rotate my bitcoin logs and do staggered backups of my wallet:

##
# logrotate.conf
# Schedule me to run in crontab:
# 0 1 * * * /usr/sbin/logrotate --state /home/rodin/.bitcoin/logrotate.state /home/rodin/.bitcoin/logrotate.conf
##

/home/rodin/.bitcoin/debug.log{
      rotate 5
      prerotate
         /home/rodin/bin/bcstop
         sleep 3
         cp ~/.bitcoin/wallet.dat.4 ~/.bitcoin/wallet.dat.5
         cp ~/.bitcoin/wallet.dat.3 ~/.bitcoin/wallet.dat.4
         cp ~/.bitcoin/wallet.dat.2 ~/.bitcoin/wallet.dat.3
         cp ~/.bitcoin/wallet.dat.1 ~/.bitcoin/wallet.dat.2
         cp ~/.bitcoin/wallet.dat ~/.bitcoin/wallet.dat.1
      endscript
      compress
      postrotate
         /home/rodin/bin/bcstart
      endscript
}



Hope this is all useful to somebody.

If you like this post, show your appreciation: 131bwEe6zWvEpnxGAqxDSqr9nsrrr7GDqH
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1474867359
Hero Member
*
Offline Offline

Posts: 1474867359

View Profile Personal Message (Offline)

Ignore
1474867359
Reply with quote  #2

1474867359
Report to moderator
1474867359
Hero Member
*
Offline Offline

Posts: 1474867359

View Profile Personal Message (Offline)

Ignore
1474867359
Reply with quote  #2

1474867359
Report to moderator
1474867359
Hero Member
*
Offline Offline

Posts: 1474867359

View Profile Personal Message (Offline)

Ignore
1474867359
Reply with quote  #2

1474867359
Report to moderator
FreeMoney
Legendary
*
Offline Offline

Activity: 1246


Strength in numbers


View Profile WWW
July 22, 2010, 09:58:04 AM
 #2

This seems super cool. I have an android, I do not have a headless client. I do have a computer I can dedicate though.

Play Bitcoin Poker at sealswithclubs.eu. We're active and open to everyone.
kiba
Legendary
*
Offline Offline

Activity: 980


View Profile
July 22, 2010, 12:01:48 PM
 #3

Look like you got me beaten to the android bitcoin client. However, I might have a trick or two up my sleeves.  Wink

Quantumplation
Member
**
Offline Offline

Activity: 84


View Profile
July 22, 2010, 12:37:27 PM
 #4

I was thinking of writing a REAL android client, not just an interface.  One that's actually crunching hashes for you. Cheesy

That gets me thinking... the client should be written so that it can "offload" some of the hash work.  Meaning, accepting possible solutions over the RPC.  So, every time it gets another transaction or starts a new block, it broadcasts it to anyone listening, then whoever's listening can crunch numbers and submit possible solutions.  The only difference being that when the "person listening" is crunching numbers, it's doing so under the original server's identity, so the original server receives the coin, instead of some new client.  This would make running it as a cluster a bit easier, as well as things like "let your phone crunch hashes too!" etc.

Against my better judgement... 1ADjszXMSRuAUjyy3ShFRy54SyRVrNDgDc
Traktion
Full Member
***
Offline Offline

Activity: 168


View Profile
July 22, 2010, 01:20:58 PM
 #5

Good to hear work is being done for Android - I love my HTC Desire!

BTW, have either of you guys considered integrating with Bump? It would be very cool to bump Bitcoins to other phones near by!  Cool
Quantumplation
Member
**
Offline Offline

Activity: 84


View Profile
July 22, 2010, 01:31:04 PM
 #6

Good to hear work is being done for Android - I love my HTC Desire!

BTW, have either of you guys considered integrating with Bump? It would be very cool to bump Bitcoins to other phones near by!  Cool

Nice idea!  I love bump!

Against my better judgement... 1ADjszXMSRuAUjyy3ShFRy54SyRVrNDgDc
rodin
Newbie
*
Offline Offline

Activity: 14


View Profile
July 22, 2010, 04:47:19 PM
 #7

Ha! My next-door neighbor works at Bump. I'll talk to him about it. However, even if you didn't "integrate" with the Bump client, you can still include a BC address in your contact info, or even make a blank contact that only has the BC address and nothing else. Then bump that, and the other person copy-pastes into the BC app and sends the money. Another slick idea: steg you BC address into your contact photo, according to a known scheme that all BC users know. Then you just send your photo around with your contact info, and your address is always there, but only BC users know about it.

Regarding a full client on the Android: since it's still mainly a mobile platform, and device batteries barely last a day as it is, I doubt that people would want the hashing to happen on their handset (and these new CPUs heat up a lot when cranking). Would it make sense to run a non-generating client on your phone? If you don't want to open the headless client to the whole world, that may be your only option.
The next thing I plan on doing is to rewrite Satoshi's code into a barebones library using straight ANSI C. That will open up lots of doors for porting, and developers would be able to directly compile for Android or iPhone or whatever, using the native toolchains, and put up whatever GUI they wanted. With a rooted phone, you can run a native bitcoind at startup, and continue to use a thin client to turn generation on/off, etc, if you really wanted that.

Anyway, a thin client is great if you're willing to run a server, which just about anyone can do. Just get yourself a dynamic hostname (e.g. from dyndns.org), open up a port in your firewall, and you're good to go.

PM me if you'd like to get an APK to play with. I should have something ready to go by the weekend. And keep those ideas going.

Cheers!

If you like this post, show your appreciation: 131bwEe6zWvEpnxGAqxDSqr9nsrrr7GDqH
db
Sr. Member
****
Offline Offline

Activity: 279



View Profile
July 22, 2010, 08:42:52 PM
 #8

If you
  • are running the headless client on a server somewhere,
  • have an Android device,
  • want to help with beta testing,
  • and will have lots of patience with my schedule...

That's me!
Traktion
Full Member
***
Offline Offline

Activity: 168


View Profile
July 23, 2010, 10:24:30 AM
 #9

Ha! My next-door neighbor works at Bump. I'll talk to him about it. However, even if you didn't "integrate" with the Bump client, you can still include a BC address in your contact info, or even make a blank contact that only has the BC address and nothing else. Then bump that, and the other person copy-pastes into the BC app and sends the money. Another slick idea: steg you BC address into your contact photo, according to a known scheme that all BC users know. Then you just send your photo around with your contact info, and your address is always there, but only BC users know about it.

Regarding a full client on the Android: since it's still mainly a mobile platform, and device batteries barely last a day as it is, I doubt that people would want the hashing to happen on their handset (and these new CPUs heat up a lot when cranking). Would it make sense to run a non-generating client on your phone? If you don't want to open the headless client to the whole world, that may be your only option.
The next thing I plan on doing is to rewrite Satoshi's code into a barebones library using straight ANSI C. That will open up lots of doors for porting, and developers would be able to directly compile for Android or iPhone or whatever, using the native toolchains, and put up whatever GUI they wanted. With a rooted phone, you can run a native bitcoind at startup, and continue to use a thin client to turn generation on/off, etc, if you really wanted that.

Anyway, a thin client is great if you're willing to run a server, which just about anyone can do. Just get yourself a dynamic hostname (e.g. from dyndns.org), open up a port in your firewall, and you're good to go.

PM me if you'd like to get an APK to play with. I should have something ready to go by the weekend. And keep those ideas going.

Cheers!

That all sounds great! I could be a guinea pig, but I'm yet to receive/generate any coins (not for want of trying), so I'm probably not much use to you.

Re bump, that's good to hear you have an ear to gnaw over integration. My reason for liking bump for payments, is because it enables simple face to face transactions. Being able to pay one another, even strangers (if they are Bitcoin, bump users) easily is a big step forward. Take the concept further and you could imagine bumping Bitcoins at shop tills. Then you start to wonder why you need credit cards, PDQ machines, business accounts and all the other expenses which go with them.

If you have a chance, could you ask your neighbour if bump could scale up to supermarkets, with lots of tills close to one another, with many transactions occurring at the same time. Would someone trying to 'wiggle' their phone near you at the till cause problems for attempted theft (if they called themselves 'Tesco Till' or some such!)? All just ponderings for a future a fair bit away... Smiley
sgtstein
Member
**
Offline Offline

Activity: 61


View Profile
July 24, 2010, 12:03:43 AM
 #10

In for testing. Just downloaded, will be installing to phone and setting up server shortly.
LZ
Staff
Legendary
*
Offline Offline

Activity: 1470


Satoshi everywhere!


View Profile WWW
October 18, 2010, 09:10:14 PM
 #11

Why I can not use it without SSL? And what about official SSL JSON-RPC support?

"Never invest unless you can afford to lose your entire investment." © S3052
kwukduck
Legendary
*
Offline Offline

Activity: 1547


View Profile
October 18, 2010, 11:34:58 PM
 #12

Well a full client that can generate coins is not realy a must i think since the devices are so slow, it will probably lockup functionality and eat battery within mere hours.
But, i do think a full client would be very nice, with it's  own wallet and being abled to send and receive, see balance, history etc.

14b8PdeWLqK3yi3PrNHMmCvSmvDEKEBh3E
mixedunicc
Newbie
*
Offline Offline

Activity: 3


View Profile WWW
October 22, 2010, 10:29:17 PM
 #13

Good to hear work is being done for Android, btw HTC Desire is best PDA.

Mobil Keluarga Ideal Terbaik Indonesia (http://mixed.uni.cc/shopping/mobil-keluarga-ideal-terbaik-indonesia/) - mixed.uni.cc >> free blog directory , Blog Directory , free submit web blog , Blog Submit , Blog Links , free submit article , blog article (http://mixed.uni.cc)
yebyen
Newbie
*
Offline Offline

Activity: 1


View Profile
November 13, 2010, 10:36:26 PM
 #14

Hey! Android-x86 is almost ready for a release (I am using it right now, Froyo-x86 now very close to where I can install your app from a market like AndAppStore)

I think that these devices are sometimes including GPUs nowadays, and for a tablet or something that is likely to be plugged into the wall and near internet, it is totally worthwhile to have a client that will hash.

My next computer is probably going to be an Android Tablet, why not port Bitcoin to GoLang, and also make the app work on Android for ARM/X86 both! Smiley

I use a firewalled bitcoin network (from the old Gavin's TEST network) and I'm pretty sure my current build produces coin that is incompatible with the standard clients, but I guess if I hadn't hooked these netbooks up to such fast computers in the first place, they would have no problem generating on a smaller block chain without so much difficulty.  They always ask, why are you making these bogus bitcoins, and I guess the reason is not all people will know about compilers!  How hard do I have to look to find a place where I can pass these off?  Maybe if I had sold them the store myself... so what good is a local currency, made more local?  I guess a money tree is pretty fun Smiley

Kingdon
Bruce Wagner
Sr. Member
****
Offline Offline

Activity: 336


View Profile
November 16, 2010, 05:59:28 PM
 #15

Someone on twitter asked me, "What would people use a Bitcoin App for Android for...

I said ...

Shop at coffee shops. Pot dealers who deliver (in Manhattan). Pay a friend for dinner, or for his birthday. Is there any limit? How do you use email? How do you use money? Combine the two.  Money as easy to send as email. Imagine. From your Android phone!

Which would be easier?

Scan the QR Code on my phone's screen to send me money?

Or type in my email address or phone number and do a lookup (or use MtGox)?

If I'm already in Your address book, your phone likely already knows my email address and/or phone number.

If this is my first visit to "The Coffee Grinder" shop, which would be easier?  Enter their phone number (& app does a lookup).....  enter an email address (& app does a lookup)....  or scan the QR Code taped to the coffee shop's cash register ....?   :-)
Bruce Wagner
Sr. Member
****
Offline Offline

Activity: 336


View Profile
November 16, 2010, 06:25:51 PM
 #16

Another Thought:   It seems like sites like MyBitcoin and MtGox already have MOST of the work done.... for mobile commerce to happen easily (which is what I want to happen).

They ALREADY have the ability to send bitcoin to any email address, for example.  And MtGox automatically returns the Bitcoin to the sender's account if it's never claimed. ...which is important in my opinion.  

What about an app that is just a front end for MtGox and/or MyBitcoin ....?

It could be "Bitcoin for Android".... but actually just be an ease of use front-end for MtGox's and/or MtBitcoin's "Send Bitcoin by Email" service.  Similar to how Twitter clients make use of Twitter faster, easier, more convenient,  and add powerful features.  

An example of one such useful feature:

Such an app could even allow me to send bitcoin when I am off-line....  on a subway or airplane or elevator ...  and then the app could automatically use the API to send the money at the very next time I have internet access (similar to my gmail Outbox).

Another useful feature:

The QR Code features.  A button called, "Display QR Code of this Receiving Address" to display the receiving address I want someone to send me money on.   ( This QR code could be generated on the fly by like "Contacts --> Share --> Barcode Scanner does..., and/or stored in the app's memory. )

And another button, "Scan QR Code to Send Payment To"....  ( I assume this could call the "Barcode Scanner" app and return the scanned value to the Send To field. )

The front-end Android app could be designed to work with BOTH, MtGox accounts AND MtBitcoin accounts.  

MoonShadow
Legendary
*
Offline Offline

Activity: 1666



View Profile
November 16, 2010, 08:39:32 PM
 #17

App is now available on the Android Market. Look for Bitcoin.
server:


Hope this is all useful to somebody.

Awesome.  The first big step to a mobile client that can contain it's own wallet.dat, trade addresses over bu.mp, and broadcast transactions over Near-field communications and/or Dash7 networking.

Within a couple years, I'll be buying my coffee with bitcoins by tapping the register and authorizing the transfer on my phone, and the coffee house will never need to know who I was...

"The powers of financial capitalism had another far-reaching aim, nothing less than to create a world system of financial control in private hands able to dominate the political system of each country and the economy of the world as a whole. This system was to be controlled in a feudalist fashion by the central banks of the world acting in concert, by secret agreements arrived at in frequent meetings and conferences. The apex of the systems was to be the Bank for International Settlements in Basel, Switzerland, a private bank owned and controlled by the world's central banks which were themselves private corporations. Each central bank...sought to dominate its government by its ability to control Treasury loans, to manipulate foreign exchanges, to influence the level of economic activity in the country, and to influence cooperative politicians by subsequent economic rewards in the business world."

- Carroll Quigley, CFR member, mentor to Bill Clinton, from 'Tragedy And Hope'
kiba
Legendary
*
Offline Offline

Activity: 980


View Profile
November 16, 2010, 08:48:27 PM
 #18

Well, since it's not open source and seem to be quite dead: I made a bounty for an android client. http://bitcointalk.org/index.php?topic=1812.0

rodin
Newbie
*
Offline Offline

Activity: 14


View Profile
February 16, 2011, 10:30:20 PM
 #19

It is open source. https://github.com/opposablebrain/BitcoinDroid

If you like this post, show your appreciation: 131bwEe6zWvEpnxGAqxDSqr9nsrrr7GDqH
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!