How to open and run QC Android Hybrid - UsingDB example in MotoDev Studio 3

22 views
Skip to first unread message

Noli Sicad

unread,
Oct 2, 2011, 6:47:12 AM10/2/11
to QuickConnect
Hi,

I am trying to learn QC Android Hybrid and I like to replicate what I
have in iOS XCode Hybrid to Android QC Hybrid.

How do you open and run - UsingDB example in MotoDev Studio 3?

It seems that QC Android Hybrid 2.1 is quite different from QC Android
Hybrid 2.0.

I need steps on how do you open this UsingDB to get me started?

I am new to MotoDev as well.

Thanks.

Noli

Noli Sicad

unread,
Oct 2, 2011, 7:23:35 AM10/2/11
to QuickConnect
I watched the old video, however, it does not relates to this new
instruction found in 2.1 (below).

This is different the video.

###########
Steps to create a QuickConnectFamily Hybrid Android application.

Do the following steps OR copy an existing example project.

1. Use MotoDev or eclipse to create a new Android application using
the Google APIs
2. Add the contents of the libs directory to your application's Build Path
3. Add maps.jar to the build path of your application for the API
level of your application. It can be found at <Android SDK
Installation>/add=ons/addon_google_apis_google_inc_<API level>/libs
4. In the build path editor select the Export tab and select all of
the jar files from the libs directory
5 Copy the contents of the Web Files directory into your
application's assets directory
6. Replace your application's res -> layout -> main.xml file with the
main.xml file in the QC Hybrid XML directory
7. Drag balloon_overlay.xml into your application's res -> layout directory
8. Replace the contents of your application's AndroidManifest.xml
file with the contents of the AndroidManifest.xml file in the XML
Files directory
9. Drag the raw directory into the res directory of your application
10. Drag the drawable directory into your application's res directory
11. Change the Activity of your Application to extends QCAndroid
12. Import the R class in your application's Activity Class.
13. Clean the project
14. Replace splash.png in the drawable directory with a background
image of your choice.
15. Modify the index.html, main.css, and the JavaScript files to
create the logic for your app

I don't know to get the UsingDB going.

Noli

Barney Cit

unread,
Oct 2, 2011, 2:13:21 PM10/2/11
to quickconn...@googlegroups.com
The UsingDB example is a MotoDev project. You should be able to import it into your workspace and then modify the paths to the qc jar files.


Lee


Sent from my iPad

> --
> You received this message because you are subscribed to the Google Groups "QuickConnect" group.
> To post to this group, send email to quickconn...@googlegroups.com.
> To unsubscribe from this group, send email to quickconnectiPh...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/quickconnectiPhone?hl=en.
>

Noli Sicad

unread,
Oct 2, 2011, 6:47:17 PM10/2/11
to quickconn...@googlegroups.com
OK. Thanks.

Now, trying to import.

Motodev / Eclipse

1. File -> Import -> General -> Existing Workspace ->Next
2.a Select root directory --(..Browse) ( selected the root directory - done!)
2.b Select the archival -- (..Browse)

What file should I select here? The selection is archive files (*.jar,
*.zip, etc.).

I could not see any jar files in Hybrid directory -->UsingDB directory.

Are the steps right?

Thanks.

Noli

Noli Sicad

unread,
Oct 3, 2011, 12:02:27 AM10/3/11
to quickconn...@googlegroups.com
OK.

I finally managed to import the UsingDB example,

1. by copying the folder UsingDB to my workspace and import from there.
2. Added the QCLib (library to the project).
- expand the QCLib
- highlighted the 4 jars -> Add path

3. Run - 4 errors (remove the path to /Users/Lee/Desktops

All most there, I got one error (below) Dalvik.

- Conversion to Dalvik format failed with error 1

Now, how to change from Android 1.6 to other Android SDK in the project?


Noli

Errors logs
[2011-10-03 14:50:30 - UsingDB] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:
Lorg/quickconnect/json/JSONInputStream;
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.processClass(Main.java:372)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.access$400(Main.java:59)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.processOne(Main.java:313)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.dx.command.dexer.Main.run(Main.java:185)
[2011-10-03 14:50:30 - UsingDB] Dx at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2011-10-03 14:50:30 - UsingDB] Dx at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[2011-10-03 14:50:30 - UsingDB] Dx at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[2011-10-03 14:50:30 - UsingDB] Dx at
java.lang.reflect.Method.invoke(Method.java:597)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:652)
[2011-10-03 14:50:30 - UsingDB] Dx at
com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:510)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
[2011-10-03 14:50:30 - UsingDB] Dx at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-10-03 14:50:31 - UsingDB] Dx 1 error; aborting
[2011-10-03 14:50:31 - UsingDB] Conversion to Dalvik format failed with error 1

Noli Sicad

unread,
Oct 3, 2011, 12:20:03 AM10/3/11
to quickconn...@googlegroups.com
OK. Change Android 1.6 (4) to Android 2.3.3 (i.e 10) in res directory
-. default.properties

# Project target.
target=Google Inc.:Google APIs:10

Now, I got 2 errors R related.

Errors (2 items)
R cannot be resolved to a variable -------------line 15
The import org.quickconnectfamily.hybrid ----line 6

Here the code in UsingDB.

package org.quickconnectfamily.usingdb;

import org.quickconnect.json.JSONException;
import org.quickconnect.json.JSONUtilities;
import org.quickconnectfamily.hybrid.QCAndroid;
import org.quickconnectfamily.hybrid.R;

import android.os.Bundle;

public class MainActivity extends QCAndroid {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

How do we fix these 2 errors.

What is the right SDK to run this example UsingDB using QCLib 2.1?

Thanks.

Noli

Noli Sicad

unread,
Oct 3, 2011, 1:47:58 AM10/3/11
to quickconn...@googlegroups.com
Now, I got this error.

[2011-10-03 16:25:13 - UsingDB] Conversion to Dalvik format failed with error 1

How you solve this error?

Have clean and build in various SDK's did not solve this problem.

Anybody in the list using Android QC aside from Lee?

Very frustrating ... Aptana and now Motodev not working properly in my
side (Mac OS X)?

Noli Sicad

unread,
Oct 3, 2011, 5:21:10 AM10/3/11
to quickconn...@googlegroups.com
Update:

It seems that you cant import this UsingDB example, it will give you error.

[2011-10-03 16:25:13 - UsingDB] Conversion to Dalvik format failed with error 1

Solution:

Redo the project, create UsingDB and recreate everything to avoid -
Dalvik error (according to some people (i.e searching google for
solution).

One project is adding the maps.jar in the right directory Android.

I did not manage to put it in right directory.

Now, I got this last problem.

2011-10-03 20:07:06 - UsingDB] ------------------------------
[2011-10-03 20:07:06 - UsingDB] Android Launch!
[2011-10-03 20:07:06 - UsingDB] adb is running normally.
[2011-10-03 20:07:06 - UsingDB] Performing
org.quickconnectfamily.hybrid.QCAndroid activity launch
[2011-10-03 20:07:06 - UsingDB] Automatic Target Mode: launching new
emulator with compatible AVD 'my_Android3.1'
[2011-10-03 20:07:06 - UsingDB] Launching a new emulator with Virtual
Device 'my_Android3.1'
[2011-10-03 20:07:07 - Emulator] PANIC: Could not open:
/tmp/.android/avd/my_Android3.1.ini


I don't why this /tmp/ directory.

My installation is in

.android/avd/my_Android3.1.ini

How to do I solve this problem?

Anybody in the list knows how to solve this?

Robert Dupuy

unread,
Oct 3, 2011, 11:56:16 AM10/3/11
to quickconn...@googlegroups.com
fyi, I wrote up in an earlier post, my experience loading up the example UsingDB in motodev.

You might find part of it useful.

I also got the Dalvik Error 1, and it appears to be if you do something like load the same library twice.

The instructions tell you to load maps.jar, but the fact is its already included in Google API's.

If you right click on UsingDB in package explorer, and select "Properties" and then go to "Android" select a choice for "Google APIs"

Then if you (also from "Properties") go to "Java Build Path" and then click on the tab "Libraries" expand your Google Api's choice by clicking on the triangle - you'll see that maps.jar is already included.

Now maybe you can extract maps.jar from its location on the filesystem, and not use the Google Api's choice, and then manually add maps.jar yourself in some way - who knows, I'm no expert, but I just used the Google Api's sdk - and it worked.

You have to install Google API's just to get maps.jar on your machine, so why not use it?

I found I didn't have to directly include maps.jar at all - and its when I came to that realization that I no longer got the Dalvik Error.

Anyway, another posting I put said that the Android software keyboard is not working.  You might want to check that immediately if you need the software keyboard.

Remember that in landscape mode, in the emulator - it doesn't support the software keyboard anyway.  And on the emulator in portrait mode, I could get the software keyboard...but on a real phone, different story.

On a real phone, the software keyboard would not appear, and so my app didn't work on any phone without a hardware keyboard.   I'm not an expert that I could figure out how to solve this within the QC framework.




Noli Sicad

unread,
Oct 3, 2011, 7:16:39 PM10/3/11
to quickconn...@googlegroups.com
Hi Robert,

Thanks for replying.

I am trying to import the Using DB example again and following your advice.

Yes, we don't need to add maps.jar. It is added automatically when you
change the SDK (e.g. Android 2.3.3, I got usb.jar as well aside from
the android.jar and maps.jar).

The Dalvik problem still persisted, no matter what I do.

####################
Description Resource Path Location Type


Conversion to Dalvik format failed with error

1 UsingDB Unknown Android Packaging Problem

####################

Some folks (google search about this Dalvik problem) are saying this
common problem when you move from projects from platform to platform
(linux to mac or linux to windows). There must be something corrupted
in the files or whatever is causing it. No matter much - Clean and
Build cycle you do.

[2011-10-04 10:05:04 - UsingDB] Dx 1 error; aborting
[2011-10-04 10:05:04 - UsingDB] Conversion to Dalvik format failed with error 1

I think the only solution is to reconstruct everything by creating
UsingDB and adding the files again.

BTW, I solved my emulator problem. Motodev, Eclipse, Aptana does not
like to run in the root userspace.

I try to run UsingDB example first, then I probably encounter software
keyboard problem later on.

Lee, what might be the problem on this software keyboard not popping up?

Thanks again.

Noli

Noli Sicad

unread,
Oct 3, 2011, 8:07:30 PM10/3/11
to quickconn...@googlegroups.com
Interesting reading about Dalvik format failed.

http://stackoverflow.com/questions/2680827/conversion-to-dalvik-format-failed-with-error-1-on-external-jar

I have not solved this problem yet in my Mac OS X 10.6.4 Motodev.

Ebenezer Kwabena Blay Ackah

unread,
Sep 15, 2014, 5:54:24 AM9/15/14
to quickconn...@googlegroups.com, quickconn...@googlegroups.com
Hi Noli, Please help me with the soft keybord  with the QC hybrid app. I have built a project for submission on 9/17/2014 and my keyboard is not showing on the real phone device. I am no expert of the QC framework. I need a breakthrough since it's my final year project work and am already caught on the deadline. Please I need help from you, Noli or Lee. I run my app using the QuickConnectfamily 2.1.2  and also tried the nlatest on githud but to no success. Still the same "software keyboard not showing issue". I am Confused and dont know what to do. I need the app to work with .sqlite database file and need enterprsie synchronisation function and thus why I love QC hybrid for. Please help me.

google

unread,
Sep 15, 2014, 11:06:12 AM9/15/14
to quickconn...@googlegroups.com
What interactions do you need between the JavaScript and Java layers? The answer to this question will allow me to focus directly on what you need.

Thanks,


Lee


To unsubscribe from this group and stop receiving emails from it, send an email to quickconnectiPh...@googlegroups.com.

To post to this group, send email to quickconn...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages