|
Member 10850253 wrote: I found this example: What example? The link points to your original question.
Member 10850253 wrote: how to get int values for red green and blue from a camera. See this[^] SO answer to retrieve the image taken by the camera. Once you have the image, use the bitmap's getPixels() method to retrieve its pixels.
If you're just getting started in Android, you may have bitten off more than you can chew. I'm not saying you won't be able to solve your problem, but you may want to proceed step by step and first gain more familiarity with programming in Android.
/ravi
|
|
|
|
|
Member 10850253 wrote: A am a newbie in android, Go to [^] where you will find lots of useful information.
|
|
|
|
|
please help me send online appointment app code
|
|
|
|
|
Sorry, this site does not provide code to order. There are many free and commercial applications that can do what you want.
|
|
|
|
|
Sure. Ask a question first.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
How can I change tempo of a jetfile in android?
|
|
|
|
|
Does this help?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hello world,
I'm working on an android app for cardboard. The purpose of the app is to make augmented reality and for the moment the only thing you can do with it is to see through the smartphone's camera. I got this functionnality from this project : https://github.com/SalahEddin/CardboardPassthrough
My problem is that I would like to show some text to the user but I don't know how to make it properly in order for the text to be shown in the two squares of the GvrView. In oder words I would like something like this : screenshot
Here are some code elements that you can find in the GitHub project.
MainActivity.Java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_live_counting_vr);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
cardboardView = (GvrView) findViewById(R.id.cardboard_view);
cardboardView.setRenderer(this);
setGvrView(cardboardView);
}
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<com.google.vrtoolkit.cardboard.CardboardView
android:id="@+id/cardboard_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
</RelativeLayout>
Thanks 
|
|
|
|
|
Thank you! I really need it 
|
|
|
|
|
|
The boss sent me the week's schedule.
He sent it as an attachment to a text message.
My Android displays a tab on that message with the word "Download" on it.
So I tap that tab.
Result...
* The word "Downloading" appears on my Android Screen
* This phrase appears on my Adroid screen: "...Couldn't download message (no subject) from So-And-So..."
Alms for the clueless will bring you blessings.
|
|
|
|
|
This is not a programming question, but I'll go ahead and offer:
1) What kind of attachment is it?
2) What happens when other people send you a text message with an attachment?
3) Does it happen with all of your boss' text messages to you, or just this particular one?
4) Are you using the stock messaging app, or a custom one?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 4-Jun-17 22:44pm.
|
|
|
|
|
DavidCrow wrote: This is not a programming question, but I'll go ahead and offer: Ooops ! Sorry for my poor brain skills. Point me to the proper place to ask this, and I'll use that.
As best I can tell, no attachment (of any kind) to any text message from anyone works on my phone.
|
|
|
|
|
hi , how i can import telegram source code in android studio ?
|
|
|
|
|
First tell us, where did you even the get the source code, and how is it Android Studio project?
Typically, most of the projects come with a directory structure, that lets your IDE easily pick up, Android Studio is smart enough to do that, secondly you can easily read the methods from the location where you downloaded the project from.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
From the main screen, use the Import project (Eclipse ADT, Gradle, etc.) option.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
hello ,
I hv tried to add itext library to the dependency , if I type itex in the search am told there is nothing to show.
Thanks .
|
|
|
|
|
|
Member 13229874 wrote: ...add itext library to the dependency... Of what? Eclipse, Android Studio, or some other IDE?
Member 13229874 wrote: if I type itex in the search... In what?
Member 13229874 wrote: ...there is nothing to show. What should be shown?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It's been a while since I've participated on CP, and I'm back with a doozy
I'm having a problem with MediaExtractor and using a MemoryFile as the data source. In the real world, this media viewer is part of a larger app that supplies a chunk of bytes that contains a complete MP4 video. To eliminate all the other stuff, I have created a little demo app that only contains the viewer and a test MemoryFile. Please note that not using a MemoryFile, i.e. saving the video data to storage and playing from there, is not an option.
First, the code. I create the MemoryFile in the test app's MainActivity.onCreate
InputStream inS = getResources ().getAssets ().open ("testmp4.mp4");
int length = inS.available ();
byte[] data = new byte[length];
inS.read (data);
inS.close ();
m_memFile = new MemoryFile (null, length);
m_memFile.writeBytes (data, 0, 0, length);
Method getFD = MemoryFile.class.getMethod ("getFileDescriptor");
m_memFileFD = (FileDescriptor) getFD.invoke (m_memFile);
This is in the MainActivity's Play button click listener:
if (m_player == null)
{
m_player = new MyPlayer (MainActivity.this.m_events, MainActivity.this.m_memFileFD, MainActivity.this.m_memFile.length (), (SurfaceView) findViewById (R.id.viewerMediaVideo));
}
m_player.play ();
The video player is in the class MyPlayer that extends Runnable:
protected MediaExtractor m_extractor = null;
protected PlayerStates m_state = PlayerStates.STOPPED;
private SurfaceHolder m_surface = null;
protected FileDescriptor m_memFileFD = null;
protected long m_memFileLen = 0;
public MyPlayer (PlayerEvents ev, FileDescriptor fd, long len, SurfaceView s)
{
m_events = ev;
m_memFileFD = fd;
m_memFileLen = len;
m_surface = s.getHolder ();
}
public void play ()
{
if (m_state == PlayerStates.STOPPED)
{
m_stop = false;
new Thread (this).start ();
}
...
}
public void run ()
{
android.os.Process.setThreadPriority (Process.THREAD_PRIORITY_URGENT_AUDIO);
m_extractor = new MediaExtractor ();
try
{
m_extractor.setDataSource (m_memFileFD, 0, m_memFileLen);
}
catch (final Exception excp)
{
m_extractor.release ();
m_extractor = null;
m_handler.post (new Runnable (){public void run ()
{m_events.onError ("can't create extractor: " + excp.getMessage ()); } });
return;
}
....
}
Now for the problem. I have tested the same APK on different devices, both actual physical phones and emulators and the results are:
S5 with 4.4.2 / API:19 emulator --> works
M9 with 5.0.2 / API:21 emulator / API:22 emulator --> works
Nexus6 with 6.0 / API:23 emulator --> works
S7 with 6.0.1 / (no emulator for this point release) --> fails
Nexus6 with 7.0 / API:24 emulator --> fails
works means the video plays correctly
fails means I get the error "can't create extractor: Failed to instantiate extractor". This is the catch at the very beginning of the player's run method
6.0.1 logcat shows thirteen lines like (only varying between the digit 0 and 4):
FileSource: seek to 0 failed
7.0 / API:24 emulator logcat contains a single line:
FileSource: offset/length adjusted from 0/547251 to 0/0
I've tried two versions of the app on the physical devices. One has a minimumSDK set to 19 and the targetSDK / compileSDK / build tools are version 21. The second version has minSDK 19 and the rest 23. The version running on the emulators has minSDK19, targetSDK 23, and compileSDK/ buildTools 25 -- the latest that I just downloaded yesterday. All three different builds of the same code fail in the same pattern based on OS version.
This points me to a change between OS versions 6.0 and 6.0.1 causing the issue. However, I've done some poking into the sources available on the net and don't see anything suspicious.
Any ideas? Do I need to go report a bug to Google?
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
Just a followup ... I never did get around to harassing Google about this. I simply worked around the problem by checking the build version and only using the "old" way with a MemoryFile for KitKat and Lollipop and using the "new with API 23" MediaDataSource with the data behind the MemoryFile for Marshmallow and up.
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
I have created android chat application. When I send message it loops all messages through notification and then show the latest message instead of just showing newest message inside the notification!!!! How to fix this issue???
public class Chat extends AppCompatActivity
{
LinearLayout layout;
RelativeLayout layout_2;
ImageView sendButton;
EditText messageArea;
ScrollView scrollView;
Firebase reference1, reference2;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
layout = (LinearLayout) findViewById(R.id.layout1);
layout_2 = (RelativeLayout)findViewById(R.id.layout2);
sendButton = (ImageView)findViewById(R.id.sendButton);
messageArea = (EditText)findViewById(R.id.messageArea);
scrollView = (ScrollView)findViewById(R.id.scrollView);
Firebase.setAndroidContext(this);
reference1 = new Firebase("https://zipa1x.firebaseio.com/messages/" + UserDetails.username + "_" + UserDetails.chatWith);
reference2 = new Firebase("https://zipa1x.firebaseio.com/messages/" + UserDetails.chatWith + "_" + UserDetails.username);
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String messageText = messageArea.getText().toString();
if(!messageText.equals("")){
Map<String, String> map = new HashMap<String, String>();
map.put("message", messageText);
map.put("user", UserDetails.username);
reference1.push().setValue(map);
reference2.push().setValue(map);
messageArea.setText("");
}
}
});
reference1.addChildEventListener(new ChildEventListener()
{
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
for (DataSnapshot child: dataSnapshot.getChildren())
{
Map map = dataSnapshot.getValue(Map.class);
String message = map.get("message").toString();
String userName = map.get("user").toString();
if (userName.equals(UserDetails.username))
{
addMessageBox("You:-\n" + message, 1);
} else
{
addMessageBox(UserDetails.chatWith + ":-\n" + message, 2);
sendNotification(message,userName);
}
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(View.FOCUS_DOWN);
}
});
}
public void addMessageBox(String message, int type){
TextView textView = new TextView(Chat.this);
textView.setText(message);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.weight = 1.0f;
if(type == 1) {
lp2.gravity = Gravity.LEFT;
textView.setBackgroundResource(R.drawable.bubble_in);
}
else{
lp2.gravity = Gravity.RIGHT;
textView.setBackgroundResource(R.drawable.bubble_out);
}
textView.setLayoutParams(lp2);
layout.addView(textView);
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(View.FOCUS_DOWN);
}
});
}
private void sendNotification(String message,String userName)
{
Intent intent = new Intent(this,Chat.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_ONE_SHOT);
Uri notificationSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(userName)
.setContentText(message)
.setSound(notificationSound)
.setContentIntent(pendingIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotificationManager.notify(0, builder.build());
}
}
|
|
|
|
|
Please provide some proper details, and explain exactly where the error occurs.
|
|
|
|
|
I would like to create an android app that will predict football result..i am planning to use neural networks behind to work in the app...how can i go about it..the difficult side is to apply the algorithm...am i going to code it or what should i do..
|
|
|
|
|
Member 13208523 wrote: .how can i go about it By starting.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|