Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

I have imported a working android project into Java Eclipse   i.e

 

 

Eclipse SDK

Version: 3.7.2
Build id: M20120208-0800

 

 

I want  it to Run as BlacKberry Project

 

Whe I run the application by using Run Configurations.

 

 

Iam seeing the following errors at   chData.java  as attached in the code below

 

 

1)

Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project tru Unknown Java Problem

 

 

2)

 

Description Resource Path Location Type
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files chData.java /tru/src/com/tru line 1 Java Problem

 

3)String cannot be resolved to a type

 

4)The import android cannot be resolved

 

 

5)Bitmap cannot be resolved to a type

 

6)  Boolean cannot be resolved to a type

 

7)Implicit super constructor Object() is undefined. Must explicitly invoke another constructor

 

 

etc   

 

 

 

                            chData.java


              

package com.tru;

import android.graphics.Bitmap;

public class chData  {
	public String mTitle="";
	public String mLink="";
	public String mImage="";
	public String mType="";
	public String mLang="";
	public String mcellnapid="";
	public String mbandwidth="";
	public int mcount;
	public Bitmap mlogo;
	public Boolean mFlgLast=false;

	chData(String t, String d, String l, String im, String il, String m,String mb) {
		mTitle =t;
		mType =d;
		mLink =l;
		mImage =im;
		mLang =il;
		mcellnapid=m;
		mbandwidth=mb;
	}

	public chData() {
		// TODO Auto-generated constructor stub
	}		
}

 

Thanks

 

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

There is no way to run Android code in a BlackBerry OS 7 or earlier system.  You will have to rewrite it.

 

You can run most Android applications in BB10 using the Runtime Library.  Find out more here:

http://developer.blackberry.com/android/

Please use plain text.
Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

If that is the case then I want to rewrite it.

 

Please suggest or guide me

 

 

 

I will update you what I tried then.

 

 

 

Thanks

Please use plain text.
Developer
simon_hain
Posts: 16,137
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

check the documentation at developer.blackberry.com
you can most likely re-use your materials and business logic, but the UI has to be replaced.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

My experience is that the way Android uses Activities and various other Android specific facilities means it is not possible to reuse the business logic related classes directly.  Data classes may be re-useable.

 

That said, the flow for processing through the application can often be replicated and this is useful since it means that changes in logic can easily be replicated across both platforms by making similar changes on both.  So while you can't share the code, you can share the logic. 

Please use plain text.
Developer
srk2012
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520

Re: Can I convert a working android App to Java App for BB 5,6 and 7.0 version mobiles also?

Ok then wait for my code only  instead of logic check your email.

Please use plain text.