« first day (271 days earlier)      last day (4681 days later) » 

2:15 AM
@Graeme I change to "Environment.getExternalStorageDirectory().getAbsolutePath()". The exception also happen.
 
2:27 AM
@Reno hi Reno
Can you help me?
 
hey
maybe :0
 
2:57 AM
@Reno Are you still out there?
 
3:28 AM
@Judy I was trying to reproduce this
Can you tell me how exactly you made a system apk. ?
I've made a build and got the pem files
and jepp I'm here
 
I put my application to source code: package/app/ , and build it
@Reno I don't understand what is pem files
I put my application to source code and use 'mmm' command to build it. And last I install it to the emulator
 
what?
 
Are you saying If I put the source code in \Android\packages\apps and create a make file, and build the full android source. I will get a system apk?
 
3:43 AM
android.uid.system
you should write this:android:sharedUserId="android.uid.system" in the manifest
and then write this :LOCAL_CERTIFICATE := platform in the make file
after these, you build your application. and then your application will has
'system user id'
 
How did you then install the apk ?
 
adb install
 
I see. It will take time to make a build and stuff. I took the shortcut. Sadly it did not work
 
not phone
ebook
I think sharedUserId="android.uid.system" cause the problem
 
4:12 AM
Got it : use FileUtils.setPermissions(yourdirpath, FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IRWXO, -1, -1);
make sure your directory exists.
 
 
1 hour later…
5:30 AM
1
Q: android shared user id and reading/writing a file

james dietriqI have been sufferring in one problem for several days. Currently I'm running in the source code of "Settings" on Android2.2. In AdroidMenifest.xml, we can see: android:sharedUserId="android.uid.system" With this, many permissions can be accessed for the activities in Settings. But with this ...

I just search the answer with keyword: android.uid.system
 
 
1 hour later…
6:41 AM
1
Q: Get Notified after 1st rotation of Text in Text View(ellipsize="marquee") in Android

KhawarWhat I have: I have a TextView with Ellipsize = Marquee. The textview's focus is true, so that I don't have to focus it manually, to start the text rotation. What I want: I want to do some operation when the 1st rotation of the text is complete. e.g. I want to show a toast or change the text of...

 
6:57 AM
@Judy oh no wonder :)
 
7:18 AM
hi
hehe
Thank you for your help.
You are very nice
 
hi @all check this question
0
Q: Facebook Application request

GanapathyI want to give Application request to the list of user from my android application. The main thing is "The App request must not go to wall , it must go to user's inbox or App request list" is there any way using graph api or facebook api.

 
7:53 AM
Not a clue I'm afraid
 
okay ..
 
@Graeme Are you online
I have fixed that problem. you can check the answer: stackoverflow.com/questions/6679011/…
 
8:15 AM
<blog spam alert>
Blogged: Mugen Extended Battery for the Nexus S Review: It’s been about 7 months now since I… http://goo.gl/fb/CBlIM
</blog spam alert>
 
@Judy I am thank you - and I have to say I don't quite understand the answer.
That's ok though - SQLite for me all the way.
 
8:31 AM
@Graeme what does 'SQLite for me all the way' mean?
 
Oh - Sorry
What I mean is:
 
@Graeme The key answer is :Processes that continue holding open fds on the sdcard a little after it is
requested to be unmounted will be killed so that it can unmount.

We don't want the system process to be able to access the sdcard to avoid
these kinds of issues (and just general security cleanliness), so that it
does not have permission to access it.
 
I use SQLite or Shared Preferences rather than file IO
What does "android.uid.system" allow?
(I could probably just look it up)
 
If you set android.uid.system this in your application manifest, the application will have the "system user id". So the application have more power to do more things, for example: you can change the system time
I can't use the SQLite and Shared Preferences in my case.
 
2
Q: Java System.out output in Unicode

Lukas KnuthI'm currently working on a text-based game in Java, which is played in the command line interpreter. The problem is, that I want to echo German umlaute (line ü ö ä ß) in the command line, which isn't supported in Windows-systems by default. However, I found a way to achieve this with a bunch of ...

someone ever done this?
 
9:26 AM
@Sathya wow that's one thick phone! :P
 
@LukasKnuth Why ask in an android room?
 
9:44 AM
Hey guys how's things?
 
@AdamLynch Because View has no such method. You will have to cast it to TextView at least.
 
How?
Can I cast v to an edittext? (which it is)
 
TextView textView = (TextView)v;
 
really?
before you answered I discovered I could do this: EditText b = (EditText)findViewById(v.getId());
 
You can, but findViewById is quite expensive operation.
 
9:54 AM
Ok thanks a mil
 
And why do you want to go circles.
findViewById will return you the same view you already have in v.
 
Yeah I realised that when I saw your answer
Not the first time I've done something like this:
In PHP, I once wrote:
echo array["{$i}"];
 
One more thing: if you use onFocusChange for multiple different views, you probably want to check if your view (v) is EditText. if (v instanceof EditText) {}
@AdamLynch that is perk of being software engineer: you discover something new every day (-.
 
thanks again
 
np
When you debug it does it enter first if branch?
 
10:03 AM
Don't think it's going inside onFocusChange
Weird
An example edittext:

<EditText
android:id="@+id/etStep1City"
android:layout_height="wrap_content"
android:background="@drawable/edittext"
android:layout_toRightOf="@+id/txtStep1City"
android:textSize="12sp"
android:layout_centerVertical="true"
android:text="@string/strStep1City"
android:textColor="@drawable/black"
android:layout_width="102dp"/>
 
So how do you attach your onFocusChange listener?
 
Ugh sorry think I didn't attach one to the one I was testing on and now my emulator's gone funny
Pretty sure I was just that stupid mistake. Thanks for the help. Gotta go for awhile now
 
Allright (-.
 
10:19 AM
@AdamLynch You should create a question for this and post the link to a question.
Unfair to other people with the same problem if you just post it here.
3
And us if we want to tell you the answer at the cost of 10 points.
;)
Hope it's solved though
 
10:35 AM
Say I've assigned a theme to an Activity in the manifest. How do I access elements of that theme via Java code in that activity, so I can modify it?
 
O_o

themes?
o_O
(that's my way of saying I'm not sure)
 
@Graeme Never looked at like that although I hate posting a question when I can get a quick answer here, especially if its a simple task
For some reason I think this is faster too even though it could easily be faster to get the answer from a question
 
Know what you mean, sometimes though even simple questions are good when you just want a quick google search to give you a clue as to what you've done wrong.
 
But if I ask it here I get after sale customer support:P
 
@Glitch What are you trying to do?
@AdamLynch lol :)
@Glitch You mean pull back the attributes assigned to x from a theme?
 
10:44 AM
yeah, I want to modify part of it, namely the background colour
 
You want to modify the theme at runtime?
Can't do it afaik
You could create variant themes / styles and switch between them
 
hmm, that's not ideal
 
I don't understand why you would want to change the value in the theme..?
 
well not change the value of a theme per se, but change the background of an activity which uses said theme
 
you can create a style (theme) with the parent of your origional theme overriding a single attribute?
Oh, just grab the root value and setBackground() ?
 
10:50 AM
How do I get the root value?
 
sorry
root layout*
 
Not sure how to do that when you're using a theme
 
findElementById(R.id.screenFourRoot).setBackground(R.drawable.backgroundTwo) ?
I'm obviously misunderstanding the question, sorry :)
 
@Glitch Does it really matter if you are using theme? Maybe you can just reference root layout and just set background value?
I mean theme is just a definition of styles and you can set style attribute (or property of a view) like usual.
 
I see
 
10:53 AM
What @Audrius said
 
Ok, so if I use the method @Graeme stated, that'd only affect the current activity, or all of them?
 
@Glitch Only current one.
 
cool, thanks
 
np
 
11:09 AM
hiii guys :)
 
hey
 
findViewById(R.style.Theme_Clear).setBackgroundColor(Color.argb(200, 255, 170, 50)); throws a nullpointerexception in onCreate () O_o
 
@Glitch findViewById works only for view Ids, e.g. R.id.something
 
right, so how am I supposed to use @Graeme's method O_o
findElementById doesn't exist
 
11:20 AM
He probably meant findViewById (-.
 
@all hi to all
 
@Audrius in which case, I'm back to square one, how do I change the background colour? :P
 
Hmm I haven't worked with themes, but wondering it styles in theme can have some kind of state (as in selector). So that you would set a state and vuala, it changes some of the properties.
 
do you mean voila?
 
@ThunderRabbit Thanks, now I know one French word (-.
 
11:25 AM
:-)
I just looked it up. voilà
with a backwards tick over the a
 
@Glitch I think it is worth posting this question on SO. It is quite interesting how one can solve it.
 
And what's even better: I just changed my variable name "matrix" to "màtrix" and my code compiles fine.
 
lol
 
Try mątrįx
 
I'm going to differentiate variable names with such pronunciation marks
@Audrius nope; couldn't do that one
 
11:30 AM
And try to restrict yourself to max 3 characters length.
(-.
 
@ThunderRabbit: hey, how is it going?
 
@Audrius awesome!!!!!
@Macarse terrrrrrrible
I'm pretty sure we're going to lose this contract and I'll get fired
but, I'm trying my best
 
ouch
 
yeah
our basic error was not using a real game engine to do this project
client has made errors as well, not getting us the data in time, but our error is worse
 
You're making a game?
 
11:33 AM
I can't disclose details, but it uses a page curl, and has animations on top of it.
 
fun
0
Q: Changing background colour of an Activity based on a theme/style

GlitchI have an Activity which has a style resource set in the manifest (using android:theme="@style/blah". I wish to dynamically change the background colour of this Activity in Java code. How would I go about doing this? Thanks!

 
trying to do the page curl with a separate library, and doing the animations by my own self on top of the curl has been a mess
 
@ThunderRabbit here is your solution make-everything-ok.com
 
I like that solution; I've been trying also to project my consciousness onto a parallel universe, but so far I seem to still be here.
A universe where 3 months ago I found Macarse, instead of 2 weeks ago when it was too late
Or a universe where I went with Unity or AndEngine or something else.
 
@ThunderRabbit: sorry to hear that :(
 
11:35 AM
So all it takes is to quickly build a time machine.
 
hello guys need your help
 
thanks Macarse; and thanks for your focused attention for a couple days. :-)
 
I want examples related to Custom ListViews with CheckBox ... I want to capture all clicked items...
 
@ThunderRabbit: np. if you have a particular issue let me know or feel free to contact me with questions. I might help you understanding why something is failing
 
Audrius, I will put a penny in a bank account with your name on it in the early 1600s if you can get me a time machine
well, right now I'm trying to draw some bitmaps the same apparent size on different density devices.
 
Using a Matrix to scale, I've got it pretty close, but not quite there yet,
 
yay for transformation matricies!
 
@ThunderRabbit: ImageView?
 
I'm drawing bitmaps inside a grandchild of View
 
@Macarse : thanks for the quick response.. lemme have a look on that.. i will ping you back
 
11:40 AM
with canvas.drawBitmap(bitmap, matrix, null);
 
oh, and you are doing it on canvas
 
yessir
 
try this instead
create an ImageView
set the bitmap
but when you create it
set the size
using scales
final float scale = getResources().getDisplayMetrics().density;
mWidth = (int) (widthInDp * scale + 0.5f);
so, it would look something like this:
 
(I'm intently scanning my code for where that will fit...) ;-)
 
@Macarse : can you please help me in my problem ?
 
11:44 AM
ImageView imageView = new ImageView(this);
imageView.setLayoutParams(new LayoutParams(mWidth, mHeight));
imageView.setScaleType(ScaleType.SOMETHING);
imageView.draw(canvas);
 
I'm not sure I can use layoutparams in my situation
there's no layout into which they can fit, exactly.
 
Hi
 
@Kartik: I guess the link I sent you is quite clear
what are you missing
 
@Glitch Answered your question - Hope that's what you're looking for?
 
@Macarse
See i am getting the data from the database and displaying it in listview..
Adapter Class Goes Like http://pastebin.com/k6ZpmXZJ
Now i want to delete checked items from listview..
 
11:52 AM
0
Q: java.lang.IllegalStateException: get field slot from row 0 col 0 failed

cyberrogHey I'm trying to implement an FastScroller with AlphabetIndexer. And I'm testing it with 500 contacts in a list view. And when trying to fast scroll it, it returns the folowing error: java.lang.IllegalStateException: get field slot from row 0 col 0 failed In this method: @Override pu...

 
@Kartik: post it as a question in stackoverflow.com
 
@Macarse : ok... should i paste the whole code here only ?
i mean in Question only ?
 
can anyone help me with that question?
 
@Kartik: I have to leave, ask the question in stackoverflow and I will try reading it later on
 
okk sure thanks alot
 
11:55 AM
???
 
@Kartik posting whole code in the question generally leads to downvotes. Instead use snippets and write the question well
and congrats, you did well in some exams I think
 
@Reno : yaa buddy.. i topped in my 8th sem again.. this was record breaking.. got 94.25% :)
i will get two gold medals finally
now i am BE IT
Between how did you came to know abt this ?
@Reno : can you please tell me what should i do if i have custom list view with checkboxes. and in view i want to get all checked checkboxes items ?
 
12:20 PM
anyone online here?
 
@cyberrog Check LogCat output, usually when you get IllegalStateException there are a lot more details than just exception itself.
 
I'd love to know how this app works market.android.com/details?id=com.haxor
 
@Audrius yeah
 
e.g. you closed database connection before time, etc.
 
I thought it was an activity that you can click through, but pressing home does not make it dissappear...
Perhaps the permissions hold a clue, "Allows an application to show system alert windows. Malicious applications can take over the entire screen."
 
12:30 PM
@Glitch that was my guess too.
 
1
Q: Get Notified after 1st rotation of Text in Text View(ellipsize="marquee") in Android

KhawarWhat I have: I have a TextView with Ellipsize = Marquee. The textview's focus is true, so that I don't have to focus it manually, to start the text rotation. What I want: I want to do some operation when the 1st rotation of the text is complete. e.g. I want to show a toast or change the text of...

 
@Audrius I need that functionality in my app for various reasons
 
@Glitch Do you need it to work in your own application or system wide?
 
basically I need to do what that app does, put a shade over the screen
it's going to act similar to F.lux: stereopsis.com/flux
 
Hey Audrius, in your answer, I think you spelled cursor with a t. stackoverflow.com/questions/6669364/…
 
12:36 PM
that's how the cool kids spell it
 
oh! my bad
 
@ThunderRabbit cheers, fixed
 
@Audrius setCursor doesnt let show my list
 
@Audrius changing system brightness I can already do, it's adding a shade that I'm working on now
I want to change the colour of the display, not just change how bright it is
 
Khawar, you've posted this question a few times in a couple days, but I don't see any updates on the question itself. What have you tried to solve it yourself?
 
12:43 PM
I think cyanogenmod does something similar, you could look it up in their source.
 
@Audrius I'm pretty sure the way they do it doesn't use the android API
 
@Glitch That might be true, but it could give you a hint. Now you can try using system alert window as in stackoverflow.com/questions/4344523/popup-window-in-any-app
 
@Audrius yep, that's what I'm doing
 
It might actually be nice thing, have never thought about shading a screen.
 
I've been using F.lux on my monitor for ages, I love it
It's just another feature to tack onto my app (lookup 'Lux' on the android market)
it's a beta
 
12:51 PM
Here is my question Updated.

http://stackoverflow.com/questions/6669364/java-lang-illegalstateexception-get-field-slot-from-row-0-col-0-failed
 
1:10 PM
hmm, setting an activity to TYPE_SYSTEM_ALERT doesn't seem to do anything
 
1:29 PM
this may sound silly, but is there a way to make a fullscreen activity without hiding the notification bar?
 
1 message moved to bin
1 message moved to bin
 
this isn't very helpful
 
Hahaha, good one (-.
 
see, my overlay works fine, but the notification bar dissappears
I can't allow that...
 
Can I take an EditText in the code behind and determine which number EditText it is in the Activity? i.e. like DOM. Within my onFocusChange() I've a general rule for all EditTexts, but I'd like to be able to get an int; like the first EditText in the Activity would return 0
@cyberrog Hey how's it going?
 
1:43 PM
@Glitch You want it full screen but with the notification bar showing?
 
yep
because this activity is transparent
so I want the activity on top of the notification bar
perhaps an activity is a bad idea
 
So you want a full screen activity that covers the notifcation bar, but is transparent over the notification bar and allows the notification bar to be touched?
 
yep
I might try a few things out
 
Hmm... Have you tried setting onTouchEvent() to return false for even the bottom layer of your application?
Long shot but might work..
 
I've got the click through stuff working already
 
1:47 PM
So it's just the display? That seems like the easy bit
 
it's just that the activity can't be fullscreen without the notification bar hiding
 
why?
 
I believe that's the standard behaviour
 
? You can make the part covering the notification bar Android.color.Transparent ?
 
I might try a popup instead of an activity
it is already transparent, but all you see is a black bar
and an animation of the bar dissappearing
 
1:49 PM
You sure you set all of the layers in your app to translucent?
 
yep
 
hmmm... weird!
 
I don't think my 'TYPE_SYSTEM_ALERT' type is being set though
its being ignored
 
2:48 PM
What the heck is wrong with this line:
long startTimeInSeconds = new Date().getTime();
?? Or is my IDE as broken as I think it is.
Nope, IDE was broken. Stupid eclipse thwap thwap
 
 
2 hours later…
5:08 PM
I wish I had rep to spare, so I could get a bounty going
 
5:32 PM
Is there any possibility to send a BroadCast to a specified Activity?
 
@H3llGhost: you can define the broadcast inside the activty
as an inner class
 
I tried it with registerReceiver(new BroadcastReceiver() {...}, IntentFilter(action)) and new Intent(context, Sender.class).setAction(action); sendBroadcast(...);
This way doesn't work?
Perhaps there is any example how to use Intent(Context packageContext, Class<?> cls) in combination with a Broadcast
 
5:52 PM
hi
 
6:15 PM
hi
Here you can find a question corresponding my problem http://stackoverflow.com/questions/6697720/send-a-broadcast-only-to-specific-activity
I want to avoid the inner class
 
7:06 PM
can anyone tell me the difference between scrollBy and scrollTo?
 
7:56 PM
hello
 
user457812
@cyberrog Figure it out?
 
user457812
Maybe that'll eventually ping him on another site..
 
i have a question abt audio recording
anyone with experience with audio recording on android?
 
user457812
Got a question on SO for it?
 
yes i have
0
Q: android:audiorecorder poor voice quality

JayPI 'm trying to record voice using audiorecorder in my android app. The recording works but its all noise. any suggestions?? Following is my code if (AUDIO_AMR.equals(mRequestedType)) { mRemainingTimeCalculator.setBitRate(BITRATE_AMR); mRec...

 
user457812
8:09 PM
Just so you know, putting a tag in the title of your question is bad
 
ok ...fixed that
 
hello
@nil hey
 
user457812
Hey, I think it worked
 
what do you mean it worked
 
user457812
@cyberrog So, figured out the difference between scrollBy and To?
 
user457812
8:12 PM
If not, By is relative, and To is absolute
 
@nil yeah. but I have a problem. When I call scrollTo() I want it to call the state SCROLL_STATE_IDLE, but the state is returning 1 not 0
 
user457812
Well, I have no idea about that.
 
I'm trying to scrollTo UP automatically in the first access of the activity, for that Im calling ScrollTo(0,0) and it automatically calls onScrollStateChanged. but the event must be 0
 
user457812
Event?
 
user457812
@JayP What are the types for mRemainingTimeCalculator and mRecorder?
 
8:17 PM
custom class to calc time & MediaRecorder
 
user457812
So mRecorder is just a plain old MediaRecorder?
 
@nil yes
 
user457812
Where does startRecording come from, then? 'Cause that's not in the docs for MediaRecorder.
 
user457812
AudioRecord has a startRecording, but it doesn't take any arguments
 
user457812
The mRecorder.mRecorder thing is also kind of strange.
 
8:25 PM
Thats a function in which i set up the parameters and call start
 
user457812
So if there's something you're not mentioning that explains the context of the code, you should start explaining it in the question
 
user457812
The error might be in whatever startRecording is, it might be elsewhere, but we can't really say 'cause you're just showing a wrapper around MediaRecorder from what I can see
 
ok
thanks will check there
and secondly is there a way to compress audio
 
user457812
My point wasn't that you need to check there, my point is that if you don't share the code in the question, nobody can help you
 
ok
 
user457812
8:27 PM
As for compression, don't know, search for it on SO and see if someone's already asked
 
user457812
If they haven't, create a question for it after you've figured out how to record audio correctly.
 
my voice recording does work ok...i tested it using a device
it seem to be garbled when i upload it on the server
 
user457812
Then why did you post code related to the recording?
 
user457812
You make it sound like the entire recording process is busted, not the output you sent to the server.
 
sorry my explanation was not clear ...trying to fix someone else's code
 
8:38 PM
hi guys, have a look at my Android Accessory vimeo.com/26415566
 
user457812
I highly approve of lego
 
@nil me too
 
 
2 hours later…
10:17 PM
layout_weight=1 should override a fill_parent from another view right?
 
hunterp: not necessarily
 
user457812
Alright, time to abandon the computer for a day and head off to a rare family dinner
 
user457812
And complain to them about everything.
 

« first day (271 days earlier)      last day (4681 days later) »