Handling squlite3 databases on a a AVD? - Android Software Development

Hi,
i am very new to Android development and my app needs to manage a sqlite3 DB. I have a few very basic questions, for which i could not find an answer in the Android dev guide. I use Eclipse with ADT Plugin 0.95 and an AVD for testing on a Wondows machine.
- With reference to "Examining sqlite3 Databases from a Remote Shell" in Developing->Tools, is adb the only option i have to launch a remote shell to handle databases? How do i do it from Eclipse?
- Is there a tool i can use to created sqlite3 databases that i can then load on my AVD or device?
Many thanks in advance,
x70

The dev docs you mention are referring to inspecting the databases on the device which is useful for debugging, you can't do this via Eclipse, only via command prompt or terminal. To handle a database in code, either extend SQLiteOpenHelper or create a custom class that interacts with your DB via Context#createOrOpenDatabase.

Related

Android SDK 1.5 emulator trouble in windows

hi i m new to xda and to android i m not tech savy
i install sdk 1.5 i try ddms it works good what when i try to lanch emulator nothing happnes and i try by going in command promt im getting this error can any one help me out in this
C:\Documents and Settings\jass>emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).
Emulator in 1.5 sdk requires you to create virtual devices. Type:
android create avd -n <name> -t 2
Enter n when it asks y/n
Then
emulator -avd <name>
Pick whatever name you like in place of <name>
All this is described in the sdk documentation. Remember, reading is fundamental!
i m getting this
C:\Documents and Settings\jass>android create avd -n <name> -t 2
The system cannot find the file specified.
C:\Documents and Settings\jass>android create avd -n <karan> -t 2
The system cannot find the file specified.
C:\Documents and Settings\jass>android create avd -n <name> -t 1
The system cannot find the file specified.
C:\Documents and Settings\jass>
you have to replace "<name>" with an actual name like foo or bar or anything you like (otherwise the shell will interpret < and > as scream redirection)
for more information run "emulator -help-virtual-device"
thanks guys!!!!!!! its working now !!!! wow!!!!!!!!
Another help needed
Hi @ll,
thanks for the last posts
My SDK is now running. but i have another question. is ther a way to download software from the market ? How can i do this with the emulator from the sdk.
I need to check out a email aplikation which communicte with exchange. But i dont have a g1. So i will try to do this with the sdk emulator.
is there a way ?
On emulator isn`t a application called market.
Can anyone help me ?
IS java installation is mondatory for installing AVD on Emulator
Dear Jashu,
IS java installation is mondatory for installing AVD on Emulator?
Anticipating u r earliest reply.
Regards
Chandrakala
jashsu said:
Emulator in 1.5 sdk requires you to create virtual devices. Type:
android create avd -n <name> -t 2
Enter n when it asks y/n
Then
emulator -avd <name>
Pick whatever name you like in place of <name>
All this is described in the sdk documentation. Remember, reading is fundamental!
Click to expand...
Click to collapse
karan09 said:
hi i m new to xda and to android i m not tech savy
i install sdk 1.5 i try ddms it works good what when i try to lanch emulator nothing happnes and i try by going in command promt im getting this error can any one help me out in this
C:\Documents and Settings\jass>emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).
Click to expand...
Click to collapse
HI KAran,
Please let me know the procedure for AVD installation on emulator.... I got struked at creating the AVD, It was asking for Java.
I had given this command
C:\<Doc..............\chandrakala>andriod create avd -n chandrakala -t 2
'java' is not recognised as an internal or an external command, operable program or batch file.
Please let me know is it mondatory to install jdk-6u10-windows-i586-p.exe.
Regards
Chandrakala
HI,
Please let me know the procedure for AVD installation on emulator.... I got struked at creating the AVD, It was asking for Java.
I had given this command
C:\<Doc..............\chandrakala>andriod create avd -n chandrakala -t 2
'java' is not recognised as an internal or an external command, operable program or batch file.
Please let me know is it mondatory to install jdk-6u10-windows-i586-p.exe.
Regards
Chandrakala
please refer to thread: http://forum.xda-developers.com/showthread.php?t=525930
this will explain how to get market / google apps working in the emulator
including creating / loading an AVD based on a current rom
If you have questions, make sure you read the eitire thread, then ask away.
also please refer to http://forum.xda-developers.com/search.php?f=446 in the future
Please let me know the procedure for AVD installation on emulator
chandrakala said:
HI,
Please let me know the procedure for AVD installation on emulator.... I got struked at creating the AVD, It was asking for Java.
I had given this command
C:\<Doc..............\chandrakala>andriod create avd -n chandrakala -t 2
'java' is not recognised as an internal or an external command, operable program or batch file.
Please let me know is it mondatory to install jdk-6u10-windows-i586-p.exe.
Regards
Chandrakala
Click to expand...
Click to collapse
ok try this web he explain step by step but first update your java
http://www.hometutorials.com/google-android.html there will be a old video this is just example he is showing to to install sdk 1 not 1.5
try like this
C:\Documents.......\chandrakala>android create avd -n chandrakala -t 2
hit enter when it ask you "Do you wish to create a custom hardware profile [no]"
and i did it on my sdk
C:\Documents and Settings\Jesse>android create avd -n chandrakala -t 2
Android 1.5 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Created AVD 'chandrakala' based on Android 1.5
when you want to start emulator enter comand like this :
C:\Documents and Settings\Jesse>emulator -avd chandrakala
it will first say this below . then emulator will start
emulator: emulator window was out of view and was recentred
Boost the android emulator speed
Hi guys decide to show you how to run emulator without avd.
Ever since I downloaded the Android SDK I rarely use the AVD to run the Image.
I Just use the emulator with c++.
I noticed there are several emulators in the SDK which are:-
emulator-arm.exe
emulator.exe
emulator-x86.exe
They all use QEMU 0.10
To use the ARM IMAGES I use the code to launch the emulator with the specified skin, processor, and many other commands which are availble.
Be carefull with the commands especially the skins since they can cause it to be resented by the emulator.
To get the C++ source codes USE THE FOLLOWING link gist://gist.github.com/2894413.git
paste the link in your browser and replace the gist since I am a new member
note you can add more parameters e.g
-icount 4
which specifys the number of instruction per clock tick
compile with c++
Note any programming language would do even using the commandline would work.
I have attached copies of the source
If this has been helpfull reply to the thread!
Good luck!

[Q] Creating/Running AVD through Eclipse with networked user profile

Our user profiles are stored on a networked share (\\shared-server\clientdata$\username). When I create an AVD through the SDK and AVD manager everything seems to appear to work correctly.
When I try to start it I get the following errors:
emulator: ERROR: unknown virtual device name: 'test_avd' emulator: could not find virtual device named 'test_avd'
I am assuming this has something to do with our user profile being on the network.
If I copy \\shared-server\clientdata$\username\.android to c:\Users\username\.android, after creating the AVD I can then start it up.
Is there an easier solution to this?

[GUIDE/Linux] Install Android SDK the "Linux way"

Hi everyone.
I will show you how to install Android SDK. After this installation, you will have CLEAN, FULLY WORKING Android SDK environment useful for PROGRAMMING, using ADB utility and for OTHER THINGS. Note that this installation will work for ALL users on one computer, so its SYSTEM-WIDE installation (best solution).
This GUIDE WILL WORK WITH ALL LINUX DISTROS (tested on Arch/Debian, 32bit PC).
------------------------------------------------
WHAT WILL YOU NEED?
- Android SDK installation files (download file for LINUX, android-sdk_rXX-linux_x86.tgz - remember to replace "XX" with actual version number you have downloaded)
- Linux machine
- internet connection
- text editor (gedit, Kate, nano or any other)
- tar (is preinstalled on all Linux distros)
------------------------------------------------
LET'S GO
Download Android SDK for Linux and store that android-sdk_rXX-linux_x86.tgz file in your home directory.
Launch terminal and navigate to your home folder with this command:
Code:
cd ~
Extract downloaded android-sdk_rXX-linux_x86.tgz file with this command:
Code:
tar xvzf android-sdk_rXX-linux_x86.tgz
After extraction, you have "android-sdk-linux_x86" folder in your home directory. Now we will copy this folder into /opt folder (i chose this folder, because its used even for JDK and its system wide directory). Copy extracted folder with this command:
Code:
sudo mv android-sdk-linux_x86 /opt/android-sdk
After this, Android SDK is copied into /opt directory.
Now we have to register our Android SDK paths with our Linux system. Path to our Android SDK is now /opt/android-sdk/. We can find folders add-ons, platforms and tools (for example) in this path. To complete Android SDK installation, open your ~/.bashrc file with your favourite text editor. If you use gedit, then use this command:
Code:
gedit ~/.bashrc
Text editor with text file opens now....
After its opened, scroll DOWN to the end of file and put on the LAST LINE of that file:
Code:
export PATH=${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
Then save file and exit text editor. This step added our Android SDK paths to Linux SYSTEM-WIDE path, so that we can use for example adb by simply typing "adb shell".
Basic installation is now complete. To make SDK usable, type this to terminal:
Code:
sudo android
If you use GNOME then write gksudo instead of sudo and when you use KDE, write kdesu instead of sudo.
ANDROID SETTINGS window will appear. Go to "Available Packages" and install
Code:
Android SDK platform-tools
Android Compatibility package
SDK Platfotm Android XX (select versions you wanna, select at least one - for example 2.3.3)
After things are downloaded and updated, close that Android Settings window.
Log out and log in to complete installation.
CHEERS!!!
If you like this GUIDE, then HIT THX button.
Have a nice day.
Why are you spamming the forum with this unnecessary cruft?
Duh... download file from web.
Extract.
done.
I mean what are you trying to do? Confuse people and drive them by force to apple?
Not everyone is as SMART as(s) you are.
So keep quiet if you have nothing positive to say to this thread.
sudo android
sudo: android: command not found
I also found this script (for ubuntu) very helpful https ://github.com/AdnanHodzic/android-sdk-installer
And it is possible to just install the eclipse plugin as a user, it will pull in the sdk. (Don't forget to install the i386 libs though)
1) Download the Android SDK for Linux and follow Google's setup directions.
2) Drop the ADB binary into /usr/bin.
3) Edit /etc/udev/rules-d/51-android.rules to read your phone.
thanks dude..I`ll try install on my debian..
kalidgate said:
sudo android
sudo: android: command not found
Click to expand...
Click to collapse
+1
HOXnoo8 said:
+1
Click to expand...
Click to collapse
cd into tools and run android
./android
This will open a GUI that allows you to download various APIs and tools such as adb and fastboot
Sent from my Nexus 7 using XDA Premium 4 mobile app

[Q] Rebuilding adb.exe for windows

Hi,
I patched the adb source code to allow for syncing a device tree to my local system (e.g. only copy files that are not already copied before) so I can do incrmenetal backups of the phone sotrage and externa sdcard.
The linux binary I build from that source works fine!
However, I also want to build the adb for windows. At first site all seems well, but when I run the adb.exe on a windows host it just does nothing. I just gets back to the command prompt without any output, not even the usage info when you run adb without andy command line options. I added a small debug printf as the first thing it does, but still no output.
So I'm seeking help on hwo to properly build adb.exe.
Here is what I have.
Development environment on a Fedora-20 64-bit machine
Installed the mingw-32-gcc toolset.
Setup 'repo' and downloaded the sdk sources.
. build/envsetup.sh
lunch sdk-eng (also tried aosp_arm-eng and aosp_x86-eng)
make adb -> gets me a working linux adb
USE_MINGW=1 make adb -> gets me an adb.exe (and api dlls) but it just does nothing, no output now window1s errors, nothing
The file type seems fine:
file adb.exe
adb.exe: PE32 executable (console) Intel 80386, for MS Windows​
which is the same as an older working adb.exe I downloaed form xda-dveloppers
Any help is much appreciated,
Thanks
How to rebuild adb tool for mac machine?

[Q] Unable to start the emulator

Hi,
I'd like to develop for Android using Qt5. I installed the SDK and the NDK, set the AVD up and tried to launch the Emulator.
If launching the x86_64 machine, the emulator's display is blank (there's only skin).
If launching the x86 machine, I only have the android logo blinking without any progress.
Command line gives the log
Code:
$ ./emulator -avd Androidx86
emulator: WARNING: Host CPU is missing the following feature(s) required for x86 emulation: SSSE3
Hardware-accelerated emulation may not work properly!
emulator: ERROR: _factory_client_recv: Unknown camera factory query name in 'listZ'
emulator: ERROR: _factory_client_recv: Unknown camera factory query name in ''
Killed
The camera is disabled, though. The emulator fails to work no matter if there's snapshotting enabled or not, the same for the "Host GPU" option.
Why does it refuse to work? I'm using Linux Mint 17 with MATE.
check if you setup the right path to the SDK
mlabouardy said:
check if you setup the right path to the SDK
Click to expand...
Click to collapse
I didn't set the path at all. I simply `cd`-ed to the sdk directory and ran the emulator
marmistrz said:
I didn't set the path at all. I simply `cd`-ed to the sdk directory and ran the emulator
Click to expand...
Click to collapse
Search for tutorial "how to set environment variable for SDK path", depend in your machine. Good luck.
Sent from here to there

Categories

Resources