Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Justin Anderson
Look for the words "caused by" in this message... It will tell you the
problem.  In this case it is a NullPointerException.

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Sun, Jul 18, 2010 at 8:49 PM, Emmen Farooq wrote:

> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.View.performClick(View.java:2344)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.View.onTouchEvent(View.java:4133)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.View.dispatchTouchEvent(View.java:3672)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:850)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
>
> com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
>
> com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.app.Activity.dispatchTouchEvent(Activity.java:1987)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
>
> com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.os.Looper.loop(Looper.java:123)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.app.ActivityThread.main(ActivityThread.java:4203)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> java.lang.reflect.Method.invoke(Method.java:521)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
>
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> dalvik.system.NativeStart.main(Native Method)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): Caused by:
> java.lang.NullPointerException
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> com.friend.profile.onCreate(profile.java:92)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
> 07-19 07:37:05.706: ERROR/AndroidRuntime(198): ... 31 more
> 07-19 07:37:05.846: DEBUG/dalvikvm(198): GC freed 3045 objects /
> 218288 bytes in 121ms
> 07-19 07:37:05.856: INFO/Process(53): Sending signal. PID: 198 SIG: 3
> 07-19 07:37:05.856: INFO/dalvikvm(198): threadid=7: reacting to signal 3
> 07-19 07:37:05.895: INFO/dalvikvm(198): Wrote stack trace to
> '/data/anr/traces.txt'
> 07-19 07:37:06.075: INFO/ARMAssembler(53): generated
> scanline__0077:03515104__ [ 27 ipp] (41 ins) at
> [0x2826e0:0x282784] in 690344 ns
> 07-19 07:37:06.086: INFO/ARMAssembler(53): generated
> scanline__0077:03515104_1001_ [ 64 ipp] (84 ins) at
> [0x282788:0x2828d8] in 1623678 ns
> 07-19 07:37:08.526: INFO/Process(198): Sending signal. PID: 198 SIG: 9
> 07-19 07:37:08.555: INFO/ActivityManager(53): Process com.friend (pid
> 198) has died.
> 07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438b7aa0
> com.friend/com.friend.main paused=false}
> 07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438e2190
> com.friend/com.friend.profile paused=false}
> 07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438b8588
> com.friend/com.friend.interest paused=false}
> 

Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Emmen Farooq
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.View.performClick(View.java:2344)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.View.onTouchEvent(View.java:4133)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.View.dispatchTouchEvent(View.java:3672)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:850)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.app.Activity.dispatchTouchEvent(Activity.java:1987)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.os.Looper.loop(Looper.java:123)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.app.ActivityThread.main(ActivityThread.java:4203)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
java.lang.reflect.Method.invokeNative(Native Method)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
java.lang.reflect.Method.invoke(Method.java:521)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
dalvik.system.NativeStart.main(Native Method)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): Caused by:
java.lang.NullPointerException
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
com.friend.profile.onCreate(profile.java:92)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
07-19 07:37:05.706: ERROR/AndroidRuntime(198): ... 31 more
07-19 07:37:05.846: DEBUG/dalvikvm(198): GC freed 3045 objects /
218288 bytes in 121ms
07-19 07:37:05.856: INFO/Process(53): Sending signal. PID: 198 SIG: 3
07-19 07:37:05.856: INFO/dalvikvm(198): threadid=7: reacting to signal 3
07-19 07:37:05.895: INFO/dalvikvm(198): Wrote stack trace to
'/data/anr/traces.txt'
07-19 07:37:06.075: INFO/ARMAssembler(53): generated
scanline__0077:03515104__ [ 27 ipp] (41 ins) at
[0x2826e0:0x282784] in 690344 ns
07-19 07:37:06.086: INFO/ARMAssembler(53): generated
scanline__0077:03515104_1001_ [ 64 ipp] (84 ins) at
[0x282788:0x2828d8] in 1623678 ns
07-19 07:37:08.526: INFO/Process(198): Sending signal. PID: 198 SIG: 9
07-19 07:37:08.555: INFO/ActivityManager(53): Process com.friend (pid
198) has died.
07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438b7aa0
com.friend/com.friend.main paused=false}
07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438e2190
com.friend/com.friend.profile paused=false}
07-19 07:37:08.555: INFO/WindowManager(53): WIN DEATH: Window{438b8588
com.friend/com.friend.interest paused=false}
07-19 07:37:08.655: INFO/ActivityManager(53): Start proc com.friend
for activity com.friend/.profile: pid=226 uid=10022 gids={}
07-19 07:37:08.965: DEBUG/dalvikvm(30): GC freed 263 objects / 10048
bytes in 304ms
07-19 07:37:09.076: INFO/jdwp(226): received file descriptor 20 from ADB
07-19 07:37:09.166: DEBUG/dalvikvm(30): GC freed 35 objects / 1536
bytes in 192ms
07-19 07:37:09.176: DEBUG/ddm-heap(226): Got feature list request
07-19 07:37:09.356: WARN/UsageStats(53): Something wrong here, didn't
expect com.friend to be resumed
07-19 07:37:09.365: DEBUG/dalvikvm(30): GC free

Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Mark Murphy
On Sun, Jul 18, 2010 at 10:43 PM, Emmen Farooq  wrote:
> you mean the tab thing should be a problem ?

I mean that in computer programming, when you encounter a crash, you
need to determine what is causing the crash. In Java, that usually
involves examining the stack trace. In Android, you use adb logcat,
DDMS, or the DDMS perspective in Eclipse to examine the stack trace.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Emmen Farooq
and im facing teh same problem for intenting between tab activities

On Mon, Jul 19, 2010 at 7:43 AM, Emmen Farooq  wrote:
> you mean the tab thing should be a problem ?
>
> On Mon, Jul 19, 2010 at 7:24 AM, Mark Murphy  wrote:
>> On Sun, Jul 18, 2010 at 10:22 PM, Emmen Farooq  
>> wrote:
>>> Kindly help me with the following scenario ,
>>>
>>> I have activity A that is tab acitvity ,  I press a certain button and
>>> go to B that is a simple activity , now on clicking a certain button
>>> on B I should be allowed to go back to A but the app crashes , how
>>> ever if i go from B to a normal activity ,it  works perfectly well ,
>>> so the problem is in A being a tab activity , please help
>>
>> Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
>> the Java stack trace associated with your crash.
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com | http://github.com/commonsguy
>> http://commonsware.com/blog | http://twitter.com/commonsguy
>>
>> _The Busy Coder's Guide to Android Development_ Version 3.1 Available!
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Beginners" group.
>>
>> NEW! Try asking and tagging your question on Stack Overflow at
>> http://stackoverflow.com/questions/tagged/android
>>
>> To unsubscribe from this group, send email to
>> android-beginners+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-beginners?hl=en
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Emmen Farooq
you mean the tab thing should be a problem ?

On Mon, Jul 19, 2010 at 7:24 AM, Mark Murphy  wrote:
> On Sun, Jul 18, 2010 at 10:22 PM, Emmen Farooq  wrote:
>> Kindly help me with the following scenario ,
>>
>> I have activity A that is tab acitvity ,  I press a certain button and
>> go to B that is a simple activity , now on clicking a certain button
>> on B I should be allowed to go back to A but the app crashes , how
>> ever if i go from B to a normal activity ,it  works perfectly well ,
>> so the problem is in A being a tab activity , please help
>
> Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
> the Java stack trace associated with your crash.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.1 Available!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Mark Murphy
On Sun, Jul 18, 2010 at 10:22 PM, Emmen Farooq  wrote:
> Kindly help me with the following scenario ,
>
> I have activity A that is tab acitvity ,  I press a certain button and
> go to B that is a simple activity , now on clicking a certain button
> on B I should be allowed to go back to A but the app crashes , how
> ever if i go from B to a normal activity ,it  works perfectly well ,
> so the problem is in A being a tab activity , please help

Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
the Java stack trace associated with your crash.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] using intent to switch between a simple activity and a tab activity

2010-07-18 Thread Emmen Farooq
Kindly help me with the following scenario ,

I have activity A that is tab acitvity ,  I press a certain button and
go to B that is a simple activity , now on clicking a certain button
on B I should be allowed to go back to A but the app crashes , how
ever if i go from B to a normal activity ,it  works perfectly well ,
so the problem is in A being a tab activity , please help

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-18 Thread Sam Hobbs
Since the methods are instance methods, I don't know what I am talking 
about.


I did not intend to imply that you don't know what you are talking 
about. I am looking forward to your guidance in the future.




DanH wrote:

"I apologize that I don't know what the Java term is that corresponds
with the C++ term static"

The Java term is "static".

Both setOnClickListener and the listener's method onClick are instance
methods, not static ones.

The argument to setOnClickListener is the reference of (pointer to)
the object instance that implements onClick.  In some cases it's
convenient for that to be the current class, but in other cases not.
"this" has no special significance in the setOnClickListener
invocation -- no different from any other reference that might be
supplied.  It simply refers to the current instance in cases where
that's the way the programmer wants to do it.

I've been programming in C++ for 14 years.  Was the lead designer/
developer for the Java implementation in IBM iSeries (which was
written in C++).  I kinda know both languages pretty well.

On Jul 18, 7:51 pm, Sam Hobbs  wrote:

Except the original question is about "this" and why it works to use it
as an argument. My comments explain why the this is missing when an
event handler is called.

I apologize that I don't know what the Java term is that corresponds
with the C++ term static, but in C++ the this pointer is the only
difference between a static and a non-static function. Providing the
this pointer in C++ as an argument for a static function allows the
event handler to do everything that a non-static function does except
the static function must use the this pointer to qualify references to
the class.

Perhaps I misunderstand what you are saying; are you saying that it is
possible to pass something else in the argument other than the this
reference? If so then that is not inconsistent with what I said or meant
to say, but the question was about the this reference.



DanH wrote:

Well, that's not exactly it.  The pointer is needed in
setOnClickListener to distinguish that specific instance of the
listener class from the thousand other possible instances in the
machine.  You'll find the analogous pointer in C++ based systems, eg.



And note that it need not be "this".  One might very well do:



MyListenerClass listener = new MyListenerClass();
someWidget.setOnClickListener(listener);



On Jul 18, 4:53 pm, Sam Hobbswrote:

I am new to Java, but since Justin says that the this reference is
essentially the same as in C++ and C# I hope my comments are helpful.



I think one point that was not made clear is that the operating system
(Android, Linux or whatever) is not written in Java but if it was
written in Java it would need to call event handlers in a manner that is
independent of the language. So when Android calls the
setOnClickListener event handler, it does not have a this reference and
could not call the event handler with this even if it knew what this is.
So it is quite common to pass the this as an argument so the event
handler can access the other members of it's class.



Keith Roberts wrote:

Hey all,



I know that the keyword "this" refers to an instance variable or can
invoke a constructor, but I don't understand how passing "this" as the
arg for setOnClickListener () works?Could someone explain?



Thanks,



keith



--
Sam Hobbs
Los Angeles, CA


--
Sam Hobbs
Los Angeles, CA




--
Sam Hobbs
Los Angeles, CA

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] list

2010-07-18 Thread Raul Martinez
i have a list with several items, when i click on one of the items i want it
to start another activity but i want it to show the name of the previous
item clicked with an image and a description of the item, how would i go
with doing that

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-18 Thread DanH
"I apologize that I don't know what the Java term is that corresponds
with the C++ term static"

The Java term is "static".

Both setOnClickListener and the listener's method onClick are instance
methods, not static ones.

The argument to setOnClickListener is the reference of (pointer to)
the object instance that implements onClick.  In some cases it's
convenient for that to be the current class, but in other cases not.
"this" has no special significance in the setOnClickListener
invocation -- no different from any other reference that might be
supplied.  It simply refers to the current instance in cases where
that's the way the programmer wants to do it.

I've been programming in C++ for 14 years.  Was the lead designer/
developer for the Java implementation in IBM iSeries (which was
written in C++).  I kinda know both languages pretty well.

On Jul 18, 7:51 pm, Sam Hobbs  wrote:
> Except the original question is about "this" and why it works to use it
> as an argument. My comments explain why the this is missing when an
> event handler is called.
>
> I apologize that I don't know what the Java term is that corresponds
> with the C++ term static, but in C++ the this pointer is the only
> difference between a static and a non-static function. Providing the
> this pointer in C++ as an argument for a static function allows the
> event handler to do everything that a non-static function does except
> the static function must use the this pointer to qualify references to
> the class.
>
> Perhaps I misunderstand what you are saying; are you saying that it is
> possible to pass something else in the argument other than the this
> reference? If so then that is not inconsistent with what I said or meant
> to say, but the question was about the this reference.
>
>
>
> DanH wrote:
> > Well, that's not exactly it.  The pointer is needed in
> > setOnClickListener to distinguish that specific instance of the
> > listener class from the thousand other possible instances in the
> > machine.  You'll find the analogous pointer in C++ based systems, eg.
>
> > And note that it need not be "this".  One might very well do:
>
> > MyListenerClass listener = new MyListenerClass();
> > someWidget.setOnClickListener(listener);
>
> > On Jul 18, 4:53 pm, Sam Hobbs  wrote:
> >> I am new to Java, but since Justin says that the this reference is
> >> essentially the same as in C++ and C# I hope my comments are helpful.
>
> >> I think one point that was not made clear is that the operating system
> >> (Android, Linux or whatever) is not written in Java but if it was
> >> written in Java it would need to call event handlers in a manner that is
> >> independent of the language. So when Android calls the
> >> setOnClickListener event handler, it does not have a this reference and
> >> could not call the event handler with this even if it knew what this is.
> >> So it is quite common to pass the this as an argument so the event
> >> handler can access the other members of it's class.
>
> >> Keith Roberts wrote:
> >>> Hey all,
>
> >>> I know that the keyword "this" refers to an instance variable or can
> >>> invoke a constructor, but I don't understand how passing "this" as the
> >>> arg for setOnClickListener () works?Could someone explain?
>
> >>> Thanks,
>
> >>> keith
>
> >> --
> >> Sam Hobbs
> >> Los Angeles, CA
>
> --
> Sam Hobbs
> Los Angeles, CA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Don't know how to show Video Thumbnails

2010-07-18 Thread Victoria
Hi,

I have been trying to display thumbnails of videos that I have stored
on the SD card of the emulator.

On stackflow someone posted the following code to a similar question
of somebody else:

int id = **"The Video's ID"**
ImageView iv = (ImageView )
convertView.findViewById(R.id.imagePreview);
ContentResolver crThumb = getContentResolver();
BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 1;
Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb,
id, MediaStore.Video.Thumbnails.MICRO_KIND, options);
iv.setImageBitmap(curThumb);

And I also read about MediaStore.Video.Thumbnails  on the android dev
site...but I have to say, that I don't fully understand it yet and I
just have no idea, if, how and where I could use that in my code. I am
really getting a bit desperate at the moment. If someone could help me
by explaining or showing me what I should do, I would be really
grateful.


This is the code I have so far...


package com.mobilevideoeditor.moved;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;




public class EditGalleryView extends Activity {
private Cursor videocursor;
//private int video_column_index;
private static int displayNameIndex = -1;
int count;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videogrid);

init_phone_video_grid();

}

private void init_phone_video_grid() {
System.gc();
String[] proj = {
MediaStore.Video.Media._ID,
MediaStore.Video.Media.DISPLAY_NAME,
MediaStore.Video.Media.DATA
};



videocursor =
managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,
null, null);
count = videocursor.getCount();

GridView vGrid=(GridView) findViewById(R.id.vgrid);
vGrid.setAdapter(new VideoAdapter(this));
}




public class VideoAdapter extends BaseAdapter {
private Context vContext;

public VideoAdapter(Context c) {
vContext = c;
}

public int getCount() {
return count;
}

public Object getItem(int position) {
return null;
}

public long getItemId(int position) {
return 0;
}



public View getView(int position, View convertView, ViewGroup
parent) {
   TextView tv;
String id;

if (convertView == null) {
// Need to create a new view
tv = new TextView(vContext);
} else {
// Otherwise, we can recycle the one given to us
tv = (TextView) convertView;
}

// Cache column index (or just hardcode it)
if (displayNameIndex == -1) {
displayNameIndex =
videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME);
}

// Bind cursor data to UI
videocursor.moveToPosition(position);
id = videocursor.getString(displayNameIndex);
tv.setText(id);

 // Bundle video URI into the view
String videoUri = videocursor.getString(2); // column
index of Media.DATA
tv.setTag(videoUri);

return tv;
}



}

}

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-18 Thread Sam Hobbs
Except the original question is about "this" and why it works to use it 
as an argument. My comments explain why the this is missing when an 
event handler is called.


I apologize that I don't know what the Java term is that corresponds 
with the C++ term static, but in C++ the this pointer is the only 
difference between a static and a non-static function. Providing the 
this pointer in C++ as an argument for a static function allows the 
event handler to do everything that a non-static function does except 
the static function must use the this pointer to qualify references to 
the class.


Perhaps I misunderstand what you are saying; are you saying that it is 
possible to pass something else in the argument other than the this 
reference? If so then that is not inconsistent with what I said or meant 
to say, but the question was about the this reference.



DanH wrote:

Well, that's not exactly it.  The pointer is needed in
setOnClickListener to distinguish that specific instance of the
listener class from the thousand other possible instances in the
machine.  You'll find the analogous pointer in C++ based systems, eg.

And note that it need not be "this".  One might very well do:

MyListenerClass listener = new MyListenerClass();
someWidget.setOnClickListener(listener);

On Jul 18, 4:53 pm, Sam Hobbs  wrote:

I am new to Java, but since Justin says that the this reference is
essentially the same as in C++ and C# I hope my comments are helpful.

I think one point that was not made clear is that the operating system
(Android, Linux or whatever) is not written in Java but if it was
written in Java it would need to call event handlers in a manner that is
independent of the language. So when Android calls the
setOnClickListener event handler, it does not have a this reference and
could not call the event handler with this even if it knew what this is.
So it is quite common to pass the this as an argument so the event
handler can access the other members of it's class.

Keith Roberts wrote:

Hey all,



I know that the keyword "this" refers to an instance variable or can
invoke a constructor, but I don't understand how passing "this" as the
arg for setOnClickListener () works?Could someone explain?



Thanks,



keith


--
Sam Hobbs
Los Angeles, CA




--
Sam Hobbs
Los Angeles, CA

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Including libraries in project

2010-07-18 Thread Mark Murphy
On Sun, Jul 18, 2010 at 4:52 PM, kypriakos  wrote:
>> Step #1: Put the JAR in libs/
> I did
>> Step #2: If using Eclipse, add it to your build path
> I did
>> Step #3: Code to the JAR's API and build your APK
> I did
>
> Even for the case of the jars that are Android-friendly they don't get
> included
> in the apk.

:: shrug ::

It works for many other developers, including hundreds of students of
mine. Since the non-Eclipse portion is pretty bulletproof, and since I
don't use Eclipse, my guess is that your problems stem from something
Eclipse-related, perhaps in the way you are putting it in your build
path.

> The libs dir is either in the src dir or the top level
> dir.

The libs/ dir is supposed to be in the root of the project dir. Now, I
have heard that you can have it located elsewhere when you are
building with Eclipse, but I have not tried that.

> Once I move
> it in the assets dir I can see it being wrapped inside the apk.

I suspect having it there will be useless.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Java Keyword This and Button Listeners.

2010-07-18 Thread DanH
Well, that's not exactly it.  The pointer is needed in
setOnClickListener to distinguish that specific instance of the
listener class from the thousand other possible instances in the
machine.  You'll find the analogous pointer in C++ based systems, eg.

And note that it need not be "this".  One might very well do:

MyListenerClass listener = new MyListenerClass();
someWidget.setOnClickListener(listener);

On Jul 18, 4:53 pm, Sam Hobbs  wrote:
> I am new to Java, but since Justin says that the this reference is
> essentially the same as in C++ and C# I hope my comments are helpful.
>
> I think one point that was not made clear is that the operating system
> (Android, Linux or whatever) is not written in Java but if it was
> written in Java it would need to call event handlers in a manner that is
> independent of the language. So when Android calls the
> setOnClickListener event handler, it does not have a this reference and
> could not call the event handler with this even if it knew what this is.
> So it is quite common to pass the this as an argument so the event
> handler can access the other members of it's class.
>
> Keith Roberts wrote:
> > Hey all,
>
> > I know that the keyword "this" refers to an instance variable or can
> > invoke a constructor, but I don't understand how passing "this" as the
> > arg for setOnClickListener () works?Could someone explain?
>
> > Thanks,
>
> > keith
>
> --
> Sam Hobbs
> Los Angeles, CA

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Database handling - when do you open and close

2010-07-18 Thread brucko
Bender,

put your db in a local Service. Open the db in onCreate() close it in
onDestroy(). Your Activities can bind and unbind to the Service as
many times as you like. The system will keep the service running as
long as  you have an activity in the foreground process bound to it or
otherwise until it needs to reclaim the resources.

Take a look at :

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html

but DONT have your binder as a non-static inner class as in the
example - or you will create a memory leak and leak your Service.
Instead, pass the binder a reference to your service in onCreate and
get the binder to null the reference out in onDestroy

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Java Keyword This and Button Listeners.

2010-07-18 Thread Sam Hobbs
I am new to Java, but since Justin says that the this reference is 
essentially the same as in C++ and C# I hope my comments are helpful.


I think one point that was not made clear is that the operating system 
(Android, Linux or whatever) is not written in Java but if it was 
written in Java it would need to call event handlers in a manner that is 
independent of the language. So when Android calls the 
setOnClickListener event handler, it does not have a this reference and 
could not call the event handler with this even if it knew what this is. 
So it is quite common to pass the this as an argument so the event 
handler can access the other members of it's class.



Keith Roberts wrote:

Hey all,

I know that the keyword "this" refers to an instance variable or can
invoke a constructor, but I don't understand how passing "this" as the
arg for setOnClickListener () works?Could someone explain?


Thanks,

keith



--
Sam Hobbs
Los Angeles, CA

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] SQL and SQLite

2010-07-18 Thread Sam Hobbs


SQLite
http://en.wikipedia.org/wiki/Sqlite

SQL
http://en.wikipedia.org/wiki/Sql



Raul Martinez wrote:

Are SQL and SQLite the same thing? If not what's the difference

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


--
Sam Hobbs
Los Angeles, CA

--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Including libraries in project

2010-07-18 Thread kypriakos

Hey Mark,

good points as always -

> There are a multitude of reasons why an existing JAR may not work on Android:
>
> -- It was compiled with Java 1.4.2 or a non-Sun/Oracle Java compiler
> -- It assumes certain classes exist (from, say, JavaSE) that do not
> ship with Android
> -- It uses JNI (and therefore needs to be adjusted to work with the NDK)
> -- It assumes certain platform binary programs exist, or exist at
> certain paths, which may not be the case on Android
> -- and so on

Exactly - the jars I am importing are from Sun's famous JXTA-JXSE
project
that was compiled with Sun's Java 1.5+ but although it does not use
JNI
I have a feeling that it assumes certain classes exist ... I noticed
the owners
of the PeerDroid project did manage to compile the J2ME-CDC version
of
JXTA-JXME under the Android platform. However, what was curious there
is that they also included external jars in their compilations
(bcprov-1.4 etc.)
that I am also try to include - I will see if I can find how they got
away with
that.

But before I can get to the bottom of this one my first issue is what
you are
describing below ...

> Step #1: Put the JAR in libs/
I did
> Step #2: If using Eclipse, add it to your build path
I did
> Step #3: Code to the JAR's API and build your APK
I did

Even for the case of the jars that are Android-friendly they don't get
included
in the apk. The libs dir is either in the src dir or the top level
dir. Once I move
it in the assets dir I can see it being wrapped inside the apk. So
before attempt
to compile the code from above I will see if I can figure this one
out.

Thanks for the pointers though - they will help

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread Mark H. Nichols

On Jul 18, 2010, at 3:41 AM, Nick Richardson wrote:

> Hopefully simple question:
> 
> I would like to create a second copy of my app and release it as a free 
> version.  I have copied my project to a new one in eclipse, but now i would 
> like to rename the project and package to upload to the market.
> 
> Is there an easy way using ADT or otherwise that will do this for me?  I 
> found a few posts online with reference to right clicking the project and 
> selecting "Rename" from "Android Tools", but i do not have that option.
> 
> If there's not an automated way, what are the steps i need to be sure to take 
> to insure that everything is renamed correctly before i upload?

If you are using Eclipse, you can use the Refactor tool to do what you want. 
Right-click on the project to be renamed, select Refactor from the object menu, 
and then rename from there.

Mark

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Database handling - when do you open and close

2010-07-18 Thread Bender
I want to get rid of the error which is telling me that there is a
leak in my app because my db gets opened twice. The db doesn't need to
be open the whole time but it is accessed quite often so I don't think
it would be very performant to open and close it for every access.

On 16 Jul., 09:10, YuviDroid  wrote:
> mmm I'm not really sure what you are trying to achieve. Exactly, at what
> times do you want to open/close the db? The db should stay open while your
> application is running? So, even when you switch among activities (yours
> activities)?
>
>
>
> On Thu, Jul 15, 2010 at 6:36 PM, Bender  wrote:
> > @YuviDroid
>
> > I'm trying the following at the moment: the open() only gets called in
> > both onCreate() methods with:
>
> >        mDb = new DbAdapter(this);
> >        if(mDb.getDatabase() == null || !mDb.getDatabase().isOpen()) {
> >          mDb.open();
> >        }
>
> > The problem I'm having with this is, that there is always a new
> > DbAdapter created which is fine when the activity is created the first
> > time. But this way "mDb.getDatabase() == null" will be always true
> > because its a new mDb.
>
> > So I either need to find a way to check if the database is opened
> > without "mDb" or need to remember mDb even if the activity is stopped.
>
> > @Kostya Vasilyev
>
> > I tried that, but then my app crashes while switching between
> > activities. When I was searching for the error I put logs in the
> > open() and close() methods by my DbAdapter and I could see the
> > following:
>
> >  * open()  (app, activity1 started)
> >  * open()  (i hit a button in activity1, activity2 is starting and
> > open is called within onStart)
> >  * close()  (activity1 is stopped, in onStop close is called)
>
> > When I go back to activity1 it throws an exception because the
> > database is closed. -.-
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > To unsubscribe from this group, send email to
> > android-beginners+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en
>
> --
> YuviDroidhttp://android.yuvalsharon.net

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] How to attach a video to an email...???

2010-07-18 Thread Victoria
Hi everyone,

I am working on a Video App, where you can click on a video from the
sdcard. This click event opens a menu (I used a options menu) that
provides the user with different sharing options, e.g. email,
bluetooth etc. This part works fine so far... What I am now trying to
do is, when the user chooses "email" the app should open the email app
of the phone via an intent (this also works fine) and should directly
attach the video he clicked before to the new email .

The last part is, where I am stuck because I don't know how to tell
the app that the video that was clicked before to open the menu should
be attached to the mail:

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setType("video/mp4");
i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(Environment.getExternalStorageDirectory(),"DON'T KNOW HOW TO
ACCESS THE CLICKE FILENAME")));
startActivity(i);



I would appreciate any advice or help. Thank you in advance

...I will post my entire code below...


package com.mobilevideoeditor.moved;

import java.io.File;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;


public class ShareGalleryView extends Activity {
private Cursor videocursor;
private int video_column_index;
int count;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videogrid);

//create new Grid View
GridView vGrid=(GridView) findViewById(R.id.vgrid);
registerForContextMenu(vGrid);
vGrid.setAdapter(new VideoAdapter(this));

init_phone_video_grid();

vGrid.setOnItemClickListener(new OnItemClickListener() {

@Override // click on item and open options menu
public void onItemClick(AdapterView parent, View v, int 
position,
long id) {
openOptionsMenu(); //Opens Options Menu by clicking on 
an item

}
});

}

private void init_phone_video_grid() {
System.gc();
String[] proj = {
MediaStore.Video.Media._ID,
MediaStore.Video.Media.DISPLAY_NAME,
MediaStore.Video.Media.DATA
};

videocursor =
managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,
null, null);
count = videocursor.getCount();
GridView vGrid=(GridView) findViewById(R.id.vgrid);
vGrid.setAdapter(new VideoAdapter(this));
}

@Override //creates options menu with menu-items
public boolean onCreateOptionsMenu(Menu menu) {

  MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.menu_gallery_share, menu);
  return super.onCreateOptionsMenu(menu);
}
@Override //what happens when a menu item is clicked
public boolean onOptionsItemSelected (MenuItem item){


 try{
//Facebook
if (item.getItemId() == R.id.menu_facebook)
{
 //TODO open fb
new AlertDialog.Builder(this)
  .setTitle("No Service")
  .setMessage("Sorry, Facebook is not supported yet!")
  .setNeutralButton("Close", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}}).show();
return true;

}
   //YouTube
else if (item.getItemId() == R.id.menu_youtube)
{
//TODO open YouTube

new AlertDialog.Builder(this)
  .setTitle("No Service")
  .setMessage("Sorry, YouTube is not supported yet!")
  .setNeutralButton("Close", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int 
which) {
// 

[android-beginners] Re: Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread DanH
As for "steps to insure everything is renamed correctly, that would be
a "clean", build, and thorough test -- what you should be doing
anyway, of course.

On Jul 18, 3:41 am, Nick Richardson  wrote:
> Hopefully simple question:
>
> I would like to create a second copy of my app and release it as a free
> version.  I have copied my project to a new one in eclipse, but now i would
> like to rename the project and package to upload to the market.
>
> Is there an easy way using ADT or otherwise that will do this for me?  I
> found a few posts online with reference to right clicking the project and
> selecting "Rename" from "Android Tools", but i do not have that option.
>
> If there's not an automated way, what are the steps i need to be sure to
> take to insure that everything is renamed correctly before i upload?
>
> Thanks,
>
> --
> //Nick Richardson
> //richardson.n...@gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread DanH
File -> Rename?  You might have to do it twice -- once on the project
and once on the package.

On Jul 18, 3:41 am, Nick Richardson  wrote:
> Hopefully simple question:
>
> I would like to create a second copy of my app and release it as a free
> version.  I have copied my project to a new one in eclipse, but now i would
> like to rename the project and package to upload to the market.
>
> Is there an easy way using ADT or otherwise that will do this for me?  I
> found a few posts online with reference to right clicking the project and
> selecting "Rename" from "Android Tools", but i do not have that option.
>
> If there's not an automated way, what are the steps i need to be sure to
> take to insure that everything is renamed correctly before i upload?
>
> Thanks,
>
> --
> //Nick Richardson
> //richardson.n...@gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


Re: [android-beginners] Re: Including libraries in project

2010-07-18 Thread Mark Murphy
On Sat, Jul 17, 2010 at 11:45 PM, kypriakos  wrote:
> But older postings and
> some
> sources supported that in general external jars may not work under
> Android

There are a multitude of reasons why an existing JAR may not work on Android:

-- It was compiled with Java 1.4.2 or a non-Sun/Oracle Java compiler
-- It assumes certain classes exist (from, say, JavaSE) that do not
ship with Android
-- It uses JNI (and therefore needs to be adjusted to work with the NDK)
-- It assumes certain platform binary programs exist, or exist at
certain paths, which may not be the case on Android
-- and so on

> and that their corresponding source should be compiled with its SDK
> before
> they can be used

That will directly resolve the compiled-with-wrong-compiler program
and will give you better error information for the
assumes-certain-classes-exist problem.

> In any
> case,
> then it makes no sense as to why the classes are not visible in the
> emulator
> even though I (finally) managed to include the jars in the apk -
> having them in
> the classpath does not do it.

Step #1: Put the JAR in libs/
Step #2: If using Eclipse, add it to your build path
Step #3: Code to the JAR's API and build your APK

and you're done...assuming the JAR is Android-friendly. For example,
here is a sample project using a re-compiled edition of the BeanShell
interpreter:

http://github.com/commonsguy/cw-android/tree/master/Java/AndShell/

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Eclipse: Easy way to refactor/rename package?

2010-07-18 Thread Nick Richardson
Hopefully simple question:

I would like to create a second copy of my app and release it as a free
version.  I have copied my project to a new one in eclipse, but now i would
like to rename the project and package to upload to the market.

Is there an easy way using ADT or otherwise that will do this for me?  I
found a few posts online with reference to right clicking the project and
selecting "Rename" from "Android Tools", but i do not have that option.

If there's not an automated way, what are the steps i need to be sure to
take to insure that everything is renamed correctly before i upload?

Thanks,

-- 
//Nick Richardson
//richardson.n...@gmail.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en