Ir para conteúdo
  • ×   Você colou conteúdo com formatação.   Remover formatação

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

  • Conteúdo Similar

    • Por lucas.sardelari
      Olá
      Estou tendo um problema ao compilar uma biblioteca no Android Studio pelo NDK Quando executo o comando ndk-build, um problema é lançado:
       
      Android NDK: Found platform level in ./project.properties. Setting APP_PLATFORM to android-19. Android NDK: WARNING: APP_PLATFORM android-19 is higher than android:minSdkVersion 1 in ./AndroidManifest.xml. NDK binaries will *not* be compatible with devices older than android-19. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_p roblems.md for more information. [arm64-v8a] Compile : FerrugemLib <= FerrugemLib.c In file included from jni/FerrugemLib.c:15: In file included from jni\CL/cl.h:32: jni\CL/cl_version.h:34:9: warning: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2) [-W#pragma-messages] #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)") ^ jni/FerrugemLib.c:346:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ jni/FerrugemLib.c:535:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ jni/FerrugemLib.c:733:25: warning: 'clCreateCommandQueue' is deprecated [-Wdeprecated-declarations] openCLObjects->queue = clCreateCommandQueue(openCLObjects->context, openCLObjects->device, 0, &err); ^ jni\CL/cl.h:1760:72: note: 'clCreateCommandQueue' has been explicitly marked deprecated here cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED; ^ jni\CL/cl_platform.h:91:70: note: expanded from macro 'CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED' #define CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED __attribute__((deprecated)) ^ jni/FerrugemLib.c:839:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ jni/FerrugemLib.c:944:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ jni/FerrugemLib.c:1977:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ jni/FerrugemLib.c:2034:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 8 warnings generated. [arm64-v8a] SharedLibrary : libFerrugemLib.so C:/Android/Sdk/ndk-bundle/build//../toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: cannot find OpenCL: No such file or directory clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [obj/local/arm64-v8a/libFerrugemLib.so] Error 1 Meu Android.mk
      LOCAL_PATH := $(call my-dir)
      LOCAL_C_INCLUDES += PATH_TO_CL_FOLDER
       
      include $(CLEAR_VARS) LOCAL_MODULE := decodeYUV420SP LOCAL_SRC_FILES := decodeYUV420SP.c LOCAL_LDLIBS := -llog -ljnigraphics include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := FerrugemLib LOCAL_SRC_FILES := FerrugemLib.c LOCAL_LDLIBS := -lOpenCL LOCAL_LDLIBS += -llog -ljnigraphics LOCAL_ALLOW_UNDEFINED_SYMBOLS := true include $(BUILD_SHARED_LIBRARY) APP_OPTIM := debug LOCAL_CFLAGS := $(call my-dir) Alguem poderia ajudar em como eu conseguir fazer dar o build com este comando: -lOpenCL
      Me propuseram a trocar o -lOpenCL por -framework OpenCL porem sem sucesso.
      Obrigado.
    • Por paulorenato
      Prezados, boa tarde;
       
      Sou novo em android studio e estou com problemas com o auto complemento de texto ao digitar os códigos. devo ter desmarcado algo sem querer, ou deletado alguma coisa, pois esta função que ao digitar uma letra do código já aprecia uma lista para escolher está desabilitada. Podem me ajudar. Obrigado
    • Por Carcleo
      Tenho um objeto 
       
      MediaPlayer mPlayer = new MediaPlayer();
       
      Objetivo: Tocar o Streaming de uma Web Rádio e funciona corretamente.
       
      Porém, quando clico em Play, leva um tempo até que a Rádio Web comece a tocar.
       
      Existe alguma forma de enquanto o streaming estiver carregando, eu pegar o percentual para passar para uma  SeekBar por exemplo?, 
       
      Como?
       
      Segue o que eu já fiz:
       
      package carcleo.com.player; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.ProgressDialog; import android.app.TaskStackBuilder; import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.MediaPlayer.OnBufferingUpdateListener; import android.os.AsyncTask; import android.os.Build; import android.support.annotation.RequiresApi; import android.support.v4.app.NotificationCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.SeekBar; import android.widget.TextView; import java.io.IOException; public class player extends AppCompatActivity implements OnBufferingUpdateListener{ private MediaPlayer mPlayer; private String URL; private Button btnPlayPause; private Boolean conexao = false; private SeekBar sb; private TextView textView; private TextView textView2; private TextView textView3; private NotificationManager mNotificationManager; private AudioManager audioManager; private ProgressDialog progressDialog; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.player); sb = findViewById(R.id.seekBar); textView = findViewById(R.id.textView); textView2 = findViewById(R.id.textView2); textView3 = findViewById(R.id.textView3); progressDialog = new ProgressDialog(this); btnPlayPause = (Button) findViewById(R.id.btnPlayPause); btnPlayPause.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { tocaPausa(); } catch (IOException e) { e.printStackTrace(); } } }); configuraAudioManager(); } private void tocaPausa() throws IOException { if (conexao == true) { if (!mPlayer.isPlaying()) { mPlayer.start(); btnPlayPause.setBackgroundResource(R.drawable.pause); } else { mPlayer.pause(); btnPlayPause.setBackgroundResource(R.drawable.play); } } else { String url = "rtsp://cdn-the-2.musicradio.com:80/LiveAudio/Capital"; // your URL here new Play().execute(url); } } private void configuraAudioManager() { audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); int volume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); sb.setMax(maxVolume); sb.setProgress(volume); sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, progress, AudioManager.FLAG_SHOW_UI); Double total = progress * 6.666666666666667; String valor =Integer.toString(Integer.valueOf(total.intValue())); textView.setText(valor+" %"); } @Override public void onStartTrackingTouch(SeekBar seekBar) {} @Override public void onStopTrackingTouch(SeekBar seekBar) {} }); } @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN) private void notificacao (){ NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.home) .setContentTitle("Rádio Capital") .setContentText("Agora deu"); Intent resultIntent = new Intent(this, player.class); TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); stackBuilder.addParentStack(player.class); stackBuilder.addNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); mBuilder.setContentIntent(resultPendingIntent); mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(1, mBuilder.build()); } private void contaBuffer () { textView2.setText(Integer.toString(mPlayer.getDuration())); mPlayer.setOnBufferingUpdateListener( new MediaPlayer.OnBufferingUpdateListener() { public void onBufferingUpdate(MediaPlayer mp, int percent) { double ratio = percent / 100.0; int bufferingLevel = (int)(mp.getDuration() * ratio); sb.setSecondaryProgress(bufferingLevel); textView2.setText(Integer.toString(bufferingLevel)); } } ); } public void mostraBuffer() { mPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { mediaPlayer.setOnInfoListener(new MediaPlayer.OnInfoListener() { @Override public boolean onInfo(MediaPlayer mp, int what, int extra) { if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END){ progressDialog.dismiss(); return true; } else if(what == MediaPlayer.MEDIA_INFO_BUFFERING_START){ progressDialog.show(); } return false; } }); } }); } @Override public void onBufferingUpdate(MediaPlayer mp, int percent) { textView3.setText(Integer.toString(percent)); } class Play extends AsyncTask<String, Void ,Boolean > { @Override protected void onPreExecute() { btnPlayPause.setBackgroundResource(R.drawable.carregando); btnPlayPause.setEnabled(false); } @Override protected Boolean doInBackground(String... params) { try { mPlayer = new MediaPlayer(); mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mPlayer.setDataSource(params[0]); mostraBuffer(); mPlayer.prepare(); // might take long! (for buffering, etc) return true; } catch (IOException e) { e.printStackTrace(); } return false; } @Override protected void onPostExecute(Boolean result) { if (result == true){ btnPlayPause.setEnabled(true); mPlayer.start(); conexao = true; btnPlayPause.setBackgroundResource(R.drawable.pause); contaBuffer(); } else { conexao = false; } } } }
    • Por Lenon John
      Eu preciso inserir mais de 3000 itens no ArrayList, o que gera o erro: method code too large.
      Acredito que usando um TXT como "BANCO DE DADOS" vai resolver o meu problema.
       
      Atualmente eu faço assim:
      -----------------------------------------------------
      ArrayList lista = new ArrayList();

      // inserindo os itens no ArrayList
      lista.add(new produtoItem(R.drawable.imagem, "AA", "AA", "AA", "AA"));

      adapter = new produtoAdapter(this, lista);
      ListView listView = (ListView) findViewById(R.id.listView1);
      listView.setAdapter(adapter);
      -----------------------------------------------------
       
      Como pegar os dados de um TXT e inserir no meu arrayList?

      OBS: Esse APP precisa funcionar sem a necessidade de internet. Ou seja, não posso usar um banco dados externo.
    • Por paodimelaun
      Estou desenvolvendo um jogo RPG para mobile e preciso de membros para formar a equipe, estou precisando pessoas que possam: fazer pixel art, logos, desenhos, ícones, efeitos sonoros, músicas. Programadores experientes também são bem vindos. 
      interessados favor deixar seu skype nos comentários.
       
      Segue o GDD(ainda imcompleto)
      https://drive.google.com/open?id=1gNtg7URzmi1n9UYMmjiyKe_WXDmjHVkZkQFLCeWq_Wo
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.