• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.appcelerator.titanium.util.Log的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Log类属于org.appcelerator.titanium.util包,在下文中一共展示了Log类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pause

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
public void pause()
{
	try {
		if (mp != null) {
			am.setMode(AudioManager.USE_DEFAULT_STREAM_TYPE);
			am.setSpeakerphoneOn(true);				  
			if(mp.isPlaying()) {
				if (DBG) {
					Log.d(LCAT,"audio is playing, pause");
				}
				//if (remote) {
					stopProgressTimer();
				//}
				mp.pause();
				paused = true;
				setState(STATE_PAUSED);
			}
		}
	} catch (Throwable t) {
		Log.w(LCAT, "Issue while pausing : " , t);
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:23,代码来源:MediaPlayerWrapper.java


示例2: reset

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
public void reset()
{
	try {
		if (mp != null) {
			//if (remote) {
				stopProgressTimer();
			//}

			setState(STATE_STOPPING);
			mp.stop();
			mp.seekTo(0);
			looping = false;
			paused = false;
			setState(STATE_STOPPED);
		}
	} catch (Throwable t) {
		Log.w(LCAT, "Issue while resetting : " , t);
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:20,代码来源:MediaPlayerWrapper.java


示例3: setVolume

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
public void setVolume(float volume)
{
	try {
		if (volume < 0.0f) {
			this.volume = 0.0f;
			Log.w(LCAT, "Attempt to set volume less than 0.0. Volume set to 0.0");
		} else if (volume > 1.0) {
			this.volume = 1.0f;
			proxy.setProperty(PROPERTY_VOLUME, volume);
			Log.w(LCAT, "Attempt to set volume greater than 1.0. Volume set to 1.0");
		} else {
			this.volume = volume; // Store in 0.0 to 1.0, scale when setting hw
		}
		if (mp != null) {
			float scaledVolume = this.volume;
			mp.setVolume(scaledVolume, scaledVolume);
		}
	} catch (Throwable t) {
		Log.w(LCAT, "Issue while setting volume : " , t);
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:22,代码来源:MediaPlayerWrapper.java


示例4: handleCreationDict

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void handleCreationDict(KrollDict options) {
	super.handleCreationDict(options);
	if (options.containsKey(TiC.PROPERTY_URL)) {
		setProperty(TiC.PROPERTY_URL, resolveUrl(null, TiConvert.toString(options, TiC.PROPERTY_URL)));
	}
	if (options.containsKey(TiC.PROPERTY_ALLOW_BACKGROUND)) {
		setProperty(TiC.PROPERTY_ALLOW_BACKGROUND, options.get(TiC.PROPERTY_ALLOW_BACKGROUND));
	}
	if(options.containsKey("speakerphone")) {
		setProperty("speakerphone", TiConvert.toBoolean(options.get("speakerphone")));
	}
	if (DBG) {
		Log.i(LCAT, "Creating audio player proxy for url: " + TiConvert.toString(getProperty("url")));
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:17,代码来源:AudioPlayerProxy.java


示例5: startRecognize

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
protected void startRecognize() {
	Log.d(LCAT, "startRecognize");
	Intent intent = null;
	switch (this.getAction()) {
	case SpeechrecognizerModule.RECOGNIZE:
		intent = getRecognizeSpeechIntent();
		break;
	case SpeechrecognizerModule.WEBSERACH:
		intent = getWebSearchIntent();
		break;
	case SpeechrecognizerModule.HANDSFREE:
		intent = getVoiceSearchHandsFree();
		break;
	}
	if (intent != null) {
		mSpeechRecognizer.startListening(intent);
	}
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:19,代码来源:SpeechRecognizerProxy.java


示例6: getRecognizeSpeechIntent

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
private Intent getRecognizeSpeechIntent() {
	Log.d(LCAT, "getRecognizeSpeechIntent");
	Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
	if (getLangmodel() == SpeechrecognizerModule.FREEFORM) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
	} else if (this.getLangmodel() == SpeechrecognizerModule.WEBSEARCH) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
	}else{
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
	}
	/*
	 * if (getPrompt() != null) {
	 * intent.putExtra(RecognizerIntent.EXTRA_PROMPT, getPrompt()); }
	 */
	if (getLangtag() != null) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, getLangtag());
	}
	intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, getMaxresult());

	intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, TiApplication
			.getInstance().getPackageName());
	return intent;
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:27,代码来源:SpeechRecognizerProxy.java


示例7: onResults

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void onResults(Bundle results) {
	Log.v(LCAT, "onResults");
	String[] heard = null;
	float[] scores = null;
	if (results != null) {
		if (results.containsKey(SpeechRecognizer.RESULTS_RECOGNITION)) {
			ArrayList<String> resultsrecog = results
					.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
			if (resultsrecog != null) {
				heard = results.getStringArrayList(
						SpeechRecognizer.RESULTS_RECOGNITION).toArray(
						new String[0]);
				if (Build.VERSION.SDK_INT >= 14) {
					scores = results
							.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
				}
			}
		}
	}
	KrollDict data = getResultKrollDict(heard, scores);
	data.put(TiC.EVENT_PROPERTY_SOURCE, SpeechRecognizerProxy.this);
	data.put(TiC.PROPERTY_TYPE, SpeechrecognizerModule.RESULTS);
	fireEvent(SpeechrecognizerModule.RESULTS, data);

}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:27,代码来源:SpeechRecognizerProxy.java


示例8: release

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
public void release()
{
	try {
		if (mp != null) {
			
			mp.setOnCompletionListener(null);
			mp.setOnErrorListener(null);
			mp.setOnBufferingUpdateListener(null);
			mp.setOnInfoListener(null);
			mp.setOnPreparedListener(null);
			
			/*
			 * Restore default stream type
			 */
			if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.KITKAT) {
				am.setMode(AudioManager.USE_DEFAULT_STREAM_TYPE);
				am.setSpeakerphoneOn(true);				     
			}
				
			mp.release();
			mp = null;
			if (DBG) {
				Log.d(LCAT, "Native resources released.");
			}
			remote = false;
		}
	} catch (Throwable t) {
		Log.w(LCAT, "Issue while releasing : " , t);
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:31,代码来源:MediaPlayerWrapper.java


示例9: setLooping

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
public void setLooping(boolean loop)
{
	try {
		if(loop != looping) {
			if (mp != null) {
				mp.setLooping(loop);
			}
			looping = loop;
		}
	} catch (Throwable t) {
		Log.w(LCAT, "Issue while configuring looping : " , t);
	}
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:14,代码来源:MediaPlayerWrapper.java


示例10: onInfo

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra)
{
	String msg = "OnInfo Unknown media issue.";

	switch(what) 
	{
		case MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING :
			msg = "Stream not interleaved or interleaved improperly.";
			break;
		case MediaPlayer.MEDIA_INFO_NOT_SEEKABLE :
			msg = "Stream does not support seeking";
			break;
		case MediaPlayer.MEDIA_INFO_UNKNOWN :
			msg = "Unknown media issue";
			break;
		case MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING :
			msg = "Video is too complex for decoder, video lagging."; // shouldn't occur, but covering bases.
			break;
		case MediaPlayer.MEDIA_INFO_METADATA_UPDATE:
			msg = "Video metadata update.";
			break;
	}
	Log.d(LCAT, "Error " + msg);

	KrollDict data = new KrollDict();
	data.put(TiC.PROPERTY_CODE, 0);
	data.put(TiC.PROPERTY_MESSAGE, msg);
	proxy.fireEvent(EVENT_ERROR, data);

	return true;
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:33,代码来源:MediaPlayerWrapper.java


示例11: onBufferingUpdate

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void onBufferingUpdate(MediaPlayer mp, int percent)
{
	if (DBG) 
	{
		Log.d(LCAT, "Buffering: " + percent + "%");
	}
	
	KrollDict data = new KrollDict();
	data.put("percent", percent);
	proxy.fireEvent(EVENT_BUFFERING, data);
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:13,代码来源:MediaPlayerWrapper.java


示例12: startProgressTimer

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
private void startProgressTimer()
{
	if (progressTimer == null) 
	{
		progressTimer = new Timer(true);
	} 
	else 
	{
		progressTimer.cancel();
		progressTimer = new Timer(true);
	}

	progressTimer.schedule(new TimerTask()
	{
		@Override
		public void run() 
		{
			if (mp != null && mp.isPlaying()) 
			{
				int position = mp.getCurrentPosition();
				if (DBG) 
				{
					Log.d(LCAT, "Progress: " + position);
				}
				KrollDict event = new KrollDict();
				event.put("progress", position);
				proxy.fireEvent(EVENT_PROGRESS, event);
			}
		}
	}, 1000, 1000);
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:32,代码来源:MediaPlayerWrapper.java


示例13: onPrepared

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void onPrepared(MediaPlayer arg0) {
	Log.d(LCAT, "In onPrepared");
	// TODO Auto-generated method stub
	//this.setState(STATE_INITIALIZED);
	//startPlay();
}
 
开发者ID:DesktopSolutionsSoftware,项目名称:android-audioplayer,代码行数:8,代码来源:MediaPlayerWrapper.java


示例14: handleCreationDict

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void handleCreationDict(KrollDict options)
{
	super.handleCreationDict(options);

	if (options.containsKey("message")) {
		Log.d(LCAT, "example created with message: " + options.get("message"));
	}
}
 
开发者ID:falkolab,项目名称:Ti.NotificationFactory,代码行数:10,代码来源:ExampleProxy.java


示例15: handleEvent

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void handleEvent(DownloadEvent event) {
	// TODO Auto-generated method stub
	Log.d(LCAT, "Download Paused ");
	KrollDict dict = createDict(event.getDownloadInformation());
	self.fireEvent(EVENT_PAUSED, dict);
	//TiMessenger.sendBlockingMainMessage(handler.obtainMessage(MSG_FIRE_PAUSED, dict));
}
 
开发者ID:kcwdevllc,项目名称:android-background-downloader,代码行数:9,代码来源:DownloaderModule.java


示例16: handleCreationDict

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Override
public void handleCreationDict(KrollDict options)
{
	super.handleCreationDict(options);
	
	if (options.containsKey("message")) {
		Log.d(TAG, "example created with message: " + options.get("message"));
	}
}
 
开发者ID:adebard,项目名称:titanium-android-telephonymanager,代码行数:10,代码来源:ExampleProxy.java


示例17: createSpeechRecognizer

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
protected void createSpeechRecognizer() {
	if (!TiApplication.isUIThread()) {
		Log.d(LCAT, "handleCreationDict not on UI Thread");
		TiMessenger.sendBlockingMainMessage(handler
				.obtainMessage(MSG_CREATESPEECHRECOGNIZER));
	} else {
		Log.d(LCAT, "handleCreationDict on UI Thread");
		createSpeechRecognizerSynch();
	}
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:11,代码来源:SpeechRecognizerProxy.java


示例18: getWebSearchIntent

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
private Intent getWebSearchIntent() {
	Log.d(LCAT, "getWebSearchIntent");
	Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
	if (getLangmodel() == SpeechrecognizerModule.FREEFORM) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
	} else if (this.getLangmodel() == SpeechrecognizerModule.WEBSEARCH) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
	}else{
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
				RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
	}
	/*
	 * if (getPrompt() != null) {
	 * intent.putExtra(RecognizerIntent.EXTRA_PROMPT, getPrompt()); }
	 */
	if (getLangtag() != null) {
		intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, getLangtag());
	}
	intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, getMaxresult());

	intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS,
			getIsPartialresult());
	if (Build.VERSION.SDK_INT >= 11) {// API Level 11 EXTRA_WEB_SEARCH_ONLY
		intent.putExtra(RecognizerIntent.EXTRA_WEB_SEARCH_ONLY,
				getIsWebsearchonly());
	}
	if (Build.VERSION.SDK_INT >= 14) {// API Level 14 EXTRA_ORIGIN
		if (getOrigin() != null) {
			intent.putExtra(RecognizerIntent.EXTRA_ORIGIN, getOrigin());
		}
	}
	intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, TiApplication
			.getInstance().getPackageName());
	return intent;
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:38,代码来源:SpeechRecognizerProxy.java


示例19: getVoiceSearchHandsFree

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
private Intent getVoiceSearchHandsFree() {
	Log.d(LCAT, "getVoiceSearchHandsFree");
	if (Build.VERSION.SDK_INT >= 16) {
		Intent intent = new Intent(
				RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
		intent.putExtra(RecognizerIntent.EXTRA_SECURE, getIsSecure());
		intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
				TiApplication.getInstance().getPackageName());
		return intent;
	}
	return null;
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:13,代码来源:SpeechRecognizerProxy.java


示例20: release

import org.appcelerator.titanium.util.Log; //导入依赖的package包/类
@Kroll.method
public void release() {
	Log.d(LCAT, "release");
	if (mSpeechRecognizer != null) {
		mSpeechRecognizer.destroy();
		mSpeechRecognizer = null;
	}
}
 
开发者ID:isis,项目名称:SpeechRecognizer-Module,代码行数:9,代码来源:SpeechRecognizerProxy.java



注:本文中的org.appcelerator.titanium.util.Log类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RunnableAction类代码示例发布时间:2022-05-22
下一篇:
Java HighlighterLayer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap