UnKnown Error
Kasper Klokker Pedersen
java android jar tablet external-library 2014-1-15 19:01:15
First of all, thanks alot for all the answers i have read to others questions. Now it’s my turn:Im Creating an android Application that should be able to load an external library on runtime. The reason for that is; my application should present the user with some different plugins, made available in the external jar.I have a dummy class: package com.something.testpublic class something() {public something() {Log.i(“sometag”, “Constructor called”);} }With use of the dx.bat file i create a dex fil
user2323030
android xml user-interface runtime margins 2014-1-15 18:57:49
I have an XML that employs the following padding in its layout:android:paddingBottom=”@dimen/activity_vertical_margin” android:paddingLeft=”@dimen/activity_horizontal_margin” android:paddingRight=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin”where both @dimen/activity_vertical_margin and @dimen/activity_horizontal_margin are 14dp each.In my Java class, I use a toast to see, at runtime, what the actual margins are:int vert = (int) getResources().getDimens
Aniket Bhosale
android drag-and-drop ontouchevent 2014-1-15 18:56:47
I am working on one app in which I am dragging (moving) one layout in any direction. If I drag it to left I want to set Image1 visibility VISIBLE and Image2 visibility GONE on it. If I drag it to right I want to set Image1 visibility GONE and Image2 visibility GONE on it.But I am not able to do it. My Code for ACTION_MOVE isfinal int X = (int) event.getRawX();final int Y = (int) event.getRawY();final int screenX = clamp((int) ev.getRawX(), 0,mDisplayMetrics.widthPixels);final int screenY = clamp
user2915571
android sqlite insert runtime 2014-1-15 18:52:47
This question is an exact duplicate of:how to insert data into sq-lite database at run-time [closed]I built an application that uses sq-lite database and within the application at run-time i made a button that when pressed added a new Edit-Text i’m wondering how can i save the values in the new Edit-Text into my database? please help me
miha
android 2014-1-15 18:44:11
I have an issue where I can’t change Switch textOn/textOff content at runtime. This means, that the following code, bound to a simple Button (for testing purposes) does not work:private int _counter = 1; @Override public void onClick(View arg0) {_sw.setTextOn(“On ” + _counter);_sw.setTextOff(“Off ” + _counter);_sw.setText(“Text” + _counter);_sw.setVisibility(_sw.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);_counter ++;_sw.invalidate(); // no effect_sw.setFocusable(true); // no effec
jQwierdy
android android-layout android-widget 2014-1-15 18:19:44
Quick question: at runtime I do a boolean check, if it returns true I would like to have two buttons in a relative layout on my MainActivity class. If its false I want to instead have two other widgets where those buttons would be (or near enough). How do I do that?
Daniel L.
android android-layout android-ui android-custom-view 2014-1-15 18:04:29
I’m changing the height and the width of my CustomView which extends Android View in runtime like this:@Overridepublic void onGlobalLayout() { if(!initialized) { int containerHeight = instance.getHeight();int containerWidth = instance.getWidth();myView.getLayoutParams().height = (int) (containerHeight * HEIGHT_RATIO);myView.getLayoutParams().width = (int) (containerWidth * WIDTH_RATIO);instance.getViewTreeObserver().removeGlobalOnLayoutListener(this);initialized = true;}}this c
Happy Go Lucky
android dynamic android-layout runtime add 2014-1-15 17:58:05
I am trying to add a tableLayout at runtime to the existing LinearLayout in main.xml. I have added a editText(R.id.editText1) in the main.xml. Here’s my code. Its not working. I get a runtime error (The application has stopped unexpectedly).public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);text = (EditText)findViewById(R.id.editText1);TableLayout tblLayout = new TableLayout(this);tblLayout.setLayoutParams(new TableLayout.LayoutParams(8,5));tblLayout.setPadding(1
Ascorbin
android context 2014-1-15 17:57:34
I want to read from a text file. In a Java app, thisBufferedReader f = new BufferedReader(new FileReader(filename));works, in Android I triedBufferedReader f = new BufferedReader (new InputStreamReader(getResources().openRawResource(R.raw.autobahnnetz_gps))) ;which crashes the app. If I use this in the main activity class, it works fine. So I guess I have to pass the context to getResources by getApplicationContext().getResourcesbut that doesnt work either. What am I missing here?
Aki
android 2014-1-15 17:42:05
It’s okay with everyone?I have a style buttons to work with high contrast, ie when the button is out of focus, white background and black font. Receives focus when the background is changed to black and need to put a white font, can not apply a white font on the button when it is selected, in an elegant way.like this…selector of white buttons: <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_enabled=
haxpanel
java stream alias red5 2014-1-15 4:25:19
I would like to create alias names for locally stored video files at runtime. For example, I have a “test/video.flv” file and I create a “abc123” alias (or “abc123.flv” if the extension matters).I would like to use these aliases for unique and disposable video path. So I need to remove them after 1 use.How to create the alias at runtime? How to remove it at runtime?
user2485710
c++ stream 2014-1-12 17:23:16
in C++ if you have a streamable class like the ios streams, an fstream or a stringstream or any other streamable type, you have a function that streams something, you want the ability to decide, at runtime, what is the direction of your stream: how you can do that ?For example I’m writing a simple parser for a binary-based file format, and I would like to use the definitions for both the input ( when reading of the file ) and the output ( when writing the file ).
Bryce Langlotz
ruby input stream terminal 2014-1-12 10:33:30
I am running a Ruby script that includes the following:def addCourses crns = []loop do Line 168system(“clear”)puts “Your CRNs:”.color(:red)crns.each do |crn|puts ” -> #{crn[:title]} (CRN: #{crn[:crn]})”.color(:magenta) end#Prompt for CRNalt = (crns.length > 0) ? ” (or just type ‘start’) ” : ” “input = ask(“\nEnter a CRN to add it#{alt}”.color(:green) + “:: “) { |q| q.echo = true } LINE 177 #Validate CRN to be 5 Digits if (input =~ /^\d{5}$/)
Fire Lancer
c++ stream string-formatting 2014-1-12 1:29:32
Usually I use streams for formatting stuff however in this case ?I don’t know the format until runtime.I want to be able to take something like the following format string: Hello {0}! Your last login was on {1,date:dd/mm/yy}. …and feed in the variables “Fire Lancer” and 1247859223, and end up with the following formatted string: Hello Fire Lancer! Your last login was on 17/07/09.In other languages I use there is built in support for this kind of thing, eg pythons format string method, however
svick
c# .net sockets tcp stream 2014-1-10 23:29:44
I’ve written a multi-threaded simple server that uses:clientStream.Read(message, 0, 4096);To block until the client has sent a message. The code then goes on to process that message.So far I’ve only been using it to send short commands ex. “#login[username][login]”but I’m worried that when I send huge table data over the line the code may continue before it has all been received.So will .Read block until the whole sent message is received, or does it unblock when any data has begun receiving?
Morgan Cheng
c# .net sockets stream crawler 2014-1-10 22:19:05
I once wrote a Crawler in .NET. In order to improve its scalability, I tried to take advantage of asynchronous API of .NET. The System.Net.HttpWebRequest has asynchronous API BeginGetResponse/EndGetResponse. However, this pair of API is just to get a HTTP response headers and a Stream instance from which we can extract HTTP response content. So, my strategy is to use BeginGetResponse/EndGetResponse to asynchronously get the response Stream, then use BeginRead/EndRead to asynchronously get bytes
Hendrik W. Hansen
c# wcf web-services data stream 2014-1-10 1:54:00
I have an assignment of exposing a service which will deliver potentially very large amounts of data (gigabytes). Thus it will have to stream data on demand, so that data is not buffered i memory. The data will undergo the following steps before being sent to the client.Extract data from database Serialize data to XML Compress the XML data with gzip Send data to the client as a streamStep 3 might be left out as compression can be done by WCF. Is there a recommended way to do this, without buffer
GSchimiti
c stream realloc 2014-1-9 17:57:55
I’m using this function to read, char by char, a text file or a stdin inputvoid readLine(FILE *stream, char **string) {char c;int counter = 0;do {c = fgetc(stream);string[0] = (char *) realloc (string[0], (counter+1) * sizeof(char));string[0][counter++] = c;} while(c != ENTER && !feof(stream));string[counter-1] = ‘\0’; }But when I call it, my program crashed and I really don’t know why, because I don’t forget the 0-terminator and I’m convinced that I stored correctly the char sequence. I
Sqeaky
c++ stream buffer-overflow 2014-1-8 8:16:45
I am concerned about buffer overflows, and I need to get some characters out of a class that derives from std::istream. From what I understand there is no way to stream to an std::string directly from an istream, without my own >> operator. So I was considering streaming the contents to a char array, then putting that into a std::string. Here is a simple example:char CharArray[1000] = {0}; SomeIStream >> CharArray; std::string StuffFromStream(CharArray);However, there seems to be no way to
Gregory Hill
objective-c ios multithreading stream 2014-1-7 23:43:38
I don’t really know for sure this is an issue with threads, but I don’t know what else could be causing my problems. I have an iOS app that has an NSStreamDelegate invoking- (void) stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCodeThe delegate is given a handle to the AppDelegate, and in every other part of the StreamDelegate, the AppDelegate exists. However, in stream:handleEvent:, when I try to pass the results back to the AppDelegate for additional processing, I get an EXC_BAD_A
Sean
android progress-bar android-webview 2014-1-12 2:36:24
The Program keeps crashing when i try to run it on my handset. cant figure out why it is crashingMain javapublic class ProgressBar extends Activity {WebView webview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.getWindow().requestFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.main );final Activity MyActivity = this;// Makes Progress bar Visible getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Win
user1340801
android runtime progress-bar updating overlapping 2014-1-11 22:07:58
Hi i am new to android and i recently changed my theme to Holo ..but the progressbar seems to overlap ..i.e a progress bar comes and stops ontop of which another continues to update the progress.. i even set the secondaryprogress to 0 also..but din work
UMAR
android progress-bar 2014-1-10 7:57:24
friends,i am using following code to display progress on andorid activity when i call web service method to getposts it show progress. but when call of serivce is complete my application gets crashed.please guide what mistake am i doing or any other alternative way to achieve this goal?mProgressStatus = 0;Thread th=new Thread(new Runnable() {public void run() {if (mProgressStatus < 100) {myProgressBar.setVisibility(View.VISIBLE);} else {myProgressBar.setVisibility(View.GONE);}}});th.start();r
Matthew
java swing timer progress-bar sleep 2014-1-10 5:19:05
I need to find a way to use the Swing Timer with a progress bar. I tried using Thread.sleep(), but it crashed the app when I used it. Any ways to use the Swing Timer instead of the Sleep()?public void piiEros(int dist) {Pii pii = new Pii();pii.setVisible(true);for(int pc = 0;100 > pc; pc++){try {Thread.sleep(dist/100);} catch (InterruptedException ex) {Logger.getLogger(Trav.class.getName()).log(Level.SEVERE, null, ex);}pii.pg.setValue(pc);}pii.dispose();o.Eros(); }NOTES: Pii is a class with t
Adam M-W
android multithreading progress-bar android-asynctask 2014-1-8 12:36:31
So I’m trying to write an AsyncTask, other UI functions seem to work onPostExecute, such as inflating and adding layouts/views but when I try to change visibility of a progress bar, I get a Null Pointer exception.I’m not using onPostExecute directly, but rather using an addObserver / callback combination, which the function contains this:ProgressBar featuredLoading = (ProgressBar)featuredLayout.findViewById(R.id.featuredLoading); featuredLoading.setVisibility(View.GONE);Any ideas?Edit: seems to
PeteMerry
c# winforms progress-bar marquee 2014-1-5 18:20:10
I created a loadingForm with only a progress bar with marquee style. In my mainForm I’m trying to do this: //before downloading loadingForm lf = new loadingForm(); lf.Show(); //start downloading //finishdownloading lf.Close();The loadingForm was shown but the progress bar didn’t appear, and the form looked like it was crash. after finishing downloading, the loadingForm was closed and my app continued to run normally. In loadingForm I only have:void loadingForm_Load(object sender, EventArgs e) {p
Gabe
vb.net multithreading progress-bar cross-threading 2013-12-28 7:05:09
I have a cmd command that needs to be executed, when the command starts it starts to fill a progressbar. When the cmd command is done the progressbar needs to fill up to 100.This is the code i use, but it gives me an error when the progressbar.Value = 100 comes up. Public Class Form1Dim teller As IntegerPrivate Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerProgressbar.Tickteller += 1ProgressBar1.Value = tellerIf ProgressBar1.Value = ProgressBar1.Maxi
Gianni Costanzi
android progress-bar visibility drawable android-linearlayout 2013-12-25 22:18:48
I was thinking about how to implement an ImageView that shows an image and while I’m refreshing its content with a new image it shows a “Loading…” text with a circular ProgressBar on the right, so I’ve written the code attached below.. Is this the correct way to implement what I want? Does the LinearLayout with TextView and ProgressBar consume zero resources when it’s visibility is set to GONE? Does the ProgressBar itself consume zero resources (I’m thinking about the progress looping circle a
Gibson
android webview progress-bar progressdialog 2013-12-19 17:34:33
Here’s one of the tabs I have that loads a page.package realstrat.cfostudio.magazineapp;import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.view.KeyEvent; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; import realstrat.cfostudio.magazineapp.R;public class TabActivity3 extends A
bash.d
c# wpf progress-bar 2013-12-18 11:06:35
I am trying to show progressbar when user is trying to login into system. Durin the operation I am showing the progressbar window to the user. I did this using a backgroundworker and it works. But sometime the system crashes. It seems windows 8 is creating the problem. Because it’s running in Windows 7 without any error.Here is my loadingview.xaml.cs code which contains the progressbar related codepublic partial class LoadingViewControl : Window {System.ComponentModel.BackgroundWorker mWorker;pu
Sulfkain
android debugging media-player videoview lg 2014-1-10 10:47:31
I have a weird problem: I have a VideoView on an activity, i get a xml file from my server, parse it and get the path of the video (i don’t post the url video, because are adult content), i set the url to the videoview.All works fine in all devices i have: xperia zr, Lg Optimus L5, Xperia tipo, htc desire hd, asus TF101, even on emulators, but on the optimus L7 i have a toast error (this video cannot reproduce) when try to play the video and i get this log:06-04 10:13:49.620: E/MediaPlayer(12861
Mark
android media-player 2014-1-10 1:43:01
I have an activity that has 12 buttons, and each one plays a separate file. I have created 12 different MediaPlayers and set them with the correct file like this:music = MediaPlayer.create(this, R.raw.music);This worked fine for just a few instances, but now it says I have too many instances and the program will just crash before anything happens. I have tried just creating one MediaPlayer instance and just try to change the file the it plays when the button is pressed by using the create method
Igal
android media-player 2014-1-9 2:30:25
I have a sound that I want to be played when a button clicked. The same sound over many activities. So I thought it could be a good idea to create a Utility class that will have the method for playing the sound and I will call it from various activities, instead of creating a MediaPlayer variable in all the other activities. So I created this Utility class:public class Utilities extends Activity {public MediaPlayer mpPositive; public MediaPlayer mpNegative;@Override protected void onCreate(Bundl
A–C
java android media-player stop 2014-1-8 8:27:22
I made an android application where you can click buttons to play sounds. Every time, you click the button, a new MediaPlayer is getting created and the problem is, when you push a button during another sound is still playing, they are playing at the same time, but I want, that the previous sounds stops when you push a button. I already tried this code but my application crashes every time I press the button:MediaPlayer mp; Button button;button = (Button) findViewById(R.id.button);button.setOnCl
JoxTraex
java android stream media-player 2014-1-7 23:27:35
I’m a Beginner in android programming and I want to programming mp3 app to call some mp3 files from URL, so when I show “Media Player” in android developer I put the URL in the setDataSource and it’s work fine, but the problem is the Activity take a lot of time to display it and in the sometimes app will be crashed. This is the part of my code :file_url = Mp3_Linkes[num];//Set Sourcetry { mp.setDataSource(file_url); } catch (Exception e) {Toast.makeText(this, “Source Error !!”, Toast.LENGTH_LO
Elaine McGovern
java android media-player sd-card mp4 2014-1-7 17:10:06
I am trying to get an mp4 playing from the SD Card. This is my second day at it. Yesterday it wouldn’t work at all and today is plays the first second of the video before the application crashes with the error: android.view.WindowManager$BadToxenException: Unable to add window — token null is not valid; is your activity running? I have a playvideo.xml file in the layout folder as such: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/re
Jebadiah
iphone ios media-player mpmovieplayercontroller 2014-1-6 13:40:21
I’m trying to load a 25-second mp4 movie from my resource file, but when I play it, my MPMoviePlayerPlaybackDidFinishNotification selector is called immediately with MPMovieFinishReasonPlaybackEnded. When I log my playback state it shows this:MPMoviePlaybackStatePlaying MPMoviePlaybackStatePaused MPMoviePlaybackStateStopped MovieFinishReasonPlaybackEnded MPMoviePlaybackStatePlaying MPMoviePlaybackStatePausedeven though I only call the play method once. I hope someone can help me.– Edited to sho
P_King
android media-player equalizer 2014-1-5 6:55:10
I have almost the same issue as where described here, answer in this post doesn’t help me, I release my equalizer immediately after setting band levels to it. It works perfect on my 4.0.4 device, it works great on friend’s 2.3.5 device, it crashes on a little percent of devices and it doesn’t matter which version of android is running on these devices.So there is error on Equalizer mEqualizer = new Equalizer(0, mediaPlayer.getAudioSessionId());java.lang.UnsupportedOperationException: Effect libr
dorien
java android media-player midi 2014-1-4 3:15:15
I want Android to play a song in /data/data/com.example.myapp/ called test3.midDo I need to put it in a subdirectory? Or am I calling setDataSource in a wrong way? The app crashes and gives me a NullPointerException.try {mediaPlayer.setDataSource(“file://data/data/com.example.optimuse/test3”);} catch (Exception e1) {e1.printStackTrace();} try {mediaPlayer.prepare();} catch (IllegalStateException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-gener
Computerish
android audio media-player 2014-1-3 17:02:32
I recently added simple looping background music to my Android game. It uses Canvas to draw to the screen, so I am very careful about optimizing performance. I added music using the standard MediaPlayer which seems to be the most common and easiest way to handing looping music. Unfortunately, I’m having trouble with the music skipping occasionally and, far worse, sometimes causing significant lag in the game play.My only phone to test on is a Droid Eris, which is a fairly old phone, so I suspect